0

I have a nightmare when i updatePHP from version 5.2.10 to 5.3.28.

HTML is UTF8, database is in UTF8. Withversion 5.2.6 everything works fine, complete web applications shows in the HTML page "čćšđČĆŽŠĐ".

In Previous version of PHP i did not have problem with UTF8:

$_SESSION['Koef'] = array(1 => "Customer", 2 => "Proračun");

now i have, č can't be saved into DB table sessions.

now i need to do : $_SESSION['Koef'] = array_map("utf8_decode",array(1 => "Stranka", 2 => "Proračun"));

but č is now displayed as Ä in HTMLpage.

When i read data from table it is UTF-8: mb_detect_encoding($s) //$s is value from DB mysql select. returned value is UTF-8

In previos version of PHP 5.2.10 value in DB Ä was displayed on HTML as č, also saving č was possible in DB it was converted to Ä, everthing works correctly. I have more than 100 table(Latin1), 200 webpages. I develop application for 3 years and have none issuses regardingof encoding when upgrading was done.

i also add mysql_set_charset("UTF-8"); did not affect changes

In the HTML page was added: is corectly displayed on browser HTML page: ŠĐČĆčćšđ

The change was made in DB table: value Ä in table column was changed to č. When data is read from db is in HTML page is writen č.

what ist the best way to update web application withno big changes that php will work same as 5.2.10? What did i misswhen i update PHP version?

Thakyou for your help.

Regards, Dani P.S. Sorry for spaces my toshiba worth 1500€ space key is not working properly.

Danijel
  • 75
  • 3
  • 11
  • possible duplicate of [UTF-8 all the way through](http://stackoverflow.com/questions/279170/utf-8-all-the-way-through) – deceze Jan 05 '14 at 11:33
  • The charset in MySQL is called `utf8`, not `UTF-8`. – deceze Jan 05 '14 at 11:36
  • "The charset in MySQL is called utf8, not UTF-8. – deceze" You are right. – Danijel Jan 05 '14 at 11:42
  • I use echo utf8_decode($s); //$s is UTF( fromDB) returned č correctly, why this be a reason,so i need to change complete web applications, i did not use "mysql_set_charset("utf8");" – Danijel Jan 05 '14 at 11:47
  • now i have issue with Č is displayed "�?". There isa mismatch with collations. how caniduplicate UTF-8,howcan i chnage this deceze? – Danijel Jan 05 '14 at 11:53
  • I don't know exactly what your problem is, because your facts are a bit jumbled and hard to deduce. Read the aforelinked question, read http://kunststube.net/frontback and other articles from that page and check each step against your app to figure out exactly what's wrong. – deceze Jan 05 '14 at 11:54
  • 1
    What about the server configuration your PHP installation is running on? Check default_charset directives on your server. – Marcel Jan 05 '14 at 12:21
  • Hi, database tables were exported from latin1 and converted to UTF8(manualy) andimported into mysqlas UTF8 with no changes of php files or other config, čćžšđ are correct displayed thank you for all your suppot that you gaveme. Regards,Dani – Danijel Jan 07 '14 at 22:25

0 Answers0