Forum Moderators: coopster

Message Too Old, No Replies

MySQL4 + UTF-8 + PHP5 = what?

Problems with non-standard characters

         

chrisjoha

10:57 am on Sep 2, 2005 (gmt 0)

10+ Year Member



I have a database with some norwegian characters in it: æ, ø and å. I tried to create the table with utf8 character encoding. Then, when inserting I do

SET NAMES utf8;

and select. I select with php and display (with correct headers) still the characters come up all f'ed up... Does anyone know how to do this correctly?

tata668

11:07 pm on Sep 2, 2005 (gmt 0)

10+ Year Member



If you use "htmlentities()" be sure to use the 'UTF-8' flag.

example:
htmlentities($value, ENT_QUOTES, 'UTF-8') ;

nickdgd

10:07 am on Sep 4, 2005 (gmt 0)

10+ Year Member



Are you referring to MySQL 4.1?

I found that everything works well in MySQL 4.0 and 3.23 using UTF-8 encoding. My homepage is using UTF-8 and it's served by FreeBSD4 + PHP 4.3.10 + MySQL 3.23

I have never used MySQL 4.1, but I heard that there're really some problems using MySQL 4.1 with UTF-8 encoding.

[edited by: coopster at 8:23 pm (utc) on Sep. 6, 2005]
[edit reason] no personal urls please TOS [webmasterworld.com] [/edit]