I have a PHP application with a MYSQL database that should “contain” UTF8 encoded data. Regarding Unicode characters, my application works correctly from start to finish. If someone sends "Strömgren" to my database (via an HTML form), I see "Strömgren" when I return data, etc.
My database tables are all UTF8, and my html pages and forms are all charset = utf-8.
I recently noticed that in one part of my application my Unicode characters turned out to be double. When I showed that there should be Strömgren, I saw Strömgren - Str \ xc3 \ xb6mgren vs Str \ xc3 \ x83 \ xc2 \ xb6mgren. If I utf8_decode a bad string, it looks correct again.
I guess this is "double coding".
I found that the double-encoded part of the application uses different code to connect to the database, and this code makes this call:
$ db-> set_charset ("utf8")
I intended to do this for ALL of my database connections, but somehow ended up in only one place. Thus, almost all of my application uses connections without the set_charset command, and Strömgren always looks right, and a single piece of code that has set_charset ("utf8") (and which only ever reads from db never writes to it), displayed incorrectly.
, , , UTF8? , Strömgren ( set_charset ( "utf8" )), , latin1 ( - ), , latin1, html- "charset = utf -8" " " Strömgren, , Strömgren. (, , , , , .)
:
-, - , ?
-, , (.. Strömgren Strömgren)?