Feb 18
  • english
  • german

I just had a strange error in a piece of PHP code. It should query a MySQL database and render an HTML selectbox out of the result. Sadly, the selectbox had exactly one entry less than the table! This entry was unique - it had an umlaut as first character and that was the clue for me: the encoding!

The database table was encoded in latin1_swedish... and the file was utf8. Initially I thought: well, if I use utf8, I'm quite safe but I was wrong - obviously. Then I used Eclipse and saved the file with iso-8859-1 encoding and hurray: it worked!

What I found confusing about this, was the fact that this very sql statement returned the completely correct result when entered in phpMyAdmin! Seems like the file encoding there was correct rightaway.

Feb 05

Ich entwickle gerade eine kleine Anwendung mit Symfony und benutze dabei das Askeet-Tutorial. Am Tag 6 des Tutorials wird eine validation YAML-Datei erstellt die login.yml heisst. Da der Inhalt bereits vorgegeben ist, hat es mich gewundert, dass ich immer folgenden Fehler bekam:

Configuration file ....../login.yml is missing "names" category

Nach längerem Probieren blieb mir schließlich nur noch das Orakel übrig. Dessen Antwort enthielt unter anderem ein Forum und das wiederum dann (dank der Suchfunktion) den entscheidenden Hinweis: Encoding und Line Endings müssen passen, sonst geht nichts! Ich hab also schnell das File als UTF8 mit LF-Endings gespeichert und siehe da, es geht!

Das hat locker ne Stunde gedauert bis ichs raus hatte - uff.