diacritics / Help Please!

diacritics

why, if i input in the database a text with some script, and i output with flowrish don't have discritic shows corectly? i must mentioned theat i make a site with flowrish but admin part with another scripts, ina dmin shhows discritics but when i optup in site don;t show, thea header is sent corectly adn the charsset is utf and mysql is set to romanian.

  • Message #514

    You are probably running into issues because of mixing character sets. You mentioned the MySQL database is using a Romanian encoding, and you are calling fHTML::sendHeader() for the Flourish stuff?

    fDatabase automatically sets the connection between the MySQL database and Flourish to use UTF-8 encoding, and MySQL should be able to properly convert the encoding from Romanian to UTF-8. My guess is that the admin interface that you built with something else is not really putting Romanian-encoded text into the database, but something else.

    The easiest way to help prevent such encoding issues is to make sure everything uses UTF-8, especially since it is such a universal character encoding. If you can't do that, you need to figure out what encoding the admin area is using and then make sure you set the MySQL connection to that encoding.

    To figure out what encoding the admin area is using, try looking at the HTTP headers and see if an encoding is specified after the mime type in the Content-Type header. If there is no charset specified, the browser will default to ISO-8859-1, which MySQL calls latin1. Depending on what characters are used, however, some browsers may actually send the content as UTF-8 because ISO-8859-1 can only represent 256 different characters. As you can see, the most fool-proof option is to use UTF-8.

    Once you have figured out the encoding that your admin area is using, see http://dev.mysql.com/doc/refman/5.0/en/charset-connection.html to learn how to set the character encoding for your MySQL connection. MySQL should then be able to convert from that encoding into the Romanian that it is using internally.

    Good luck!

    • Message #516

      so, i think right. so in the header HTTP Status Code: HTTP/1.1 200 OK Date: Sun, 15 Nov 2009 21:53:42 GMT Server: Apache/2.2.11 (Win32) PHP/5.3.0 X-Powered-By: PHP/5.3.0 Set-Cookie: PHPSESSID=ufsqqc6cf2eiuq1raot3r9d9p2; path=/ Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Content-Encoding: gzip Vary: Accept-Encoding Content-Length: 2522 Connection: close Content-Type: text/html

      so as you say i think is latin. i look into phpmyadmin and even there don't show corectly, only in admin. i don't sure i understood what you sugest. is to make the table utf8_bin? that did't work, i cannot understand why only in admin show that diactitics.