php - Latvian characters into MySQL Database converting -



php - Latvian characters into MySQL Database converting -

i have problem. have info in db in latvian (i.e valentīna) , need display on page. other info saved in cp1257 encoding , looks aÎda macijevska - , displays aīda macijevska

so have tried...

1 - ucwords(mb_strtolower(iconv("windows-1257", "utf-8//translit", trim($row['pac_name'])), "utf-8")); 2 - ucwords(mb_strtolower(iconv("windows-1257", "utf-8", trim($row['pac_name'])), "utf-8")); 3 - show without converting db `$row["pac_name"]`;

and 3 points display same result - valent?na

p.s database has utf8_general_ci collation, gave header utf-8 encoding - header('content-type: text/html; charset=utf-8');

so can please help me problem?

assuming using cp1257 , not utf8, need

set names cp1257 (or other way client tell mysqld bytes encoded using cp1257) character set cp1257 on each column (or perhaps defaulting table definition).

but sounds should go utf8, not cp1257...

as see it, Î not exist in cp1257. reference: http://en.wikipedia.org/wiki/windows-1257 . hence, code mentioned free screw up, either using ī or ?.

if need i-hat, go utf8. note collation utf8_latvian_ci exists. i's mentioned here exist in utf8.

if have farther questions, please provide select hex(col)... text in question. illustration (with spaces added clarity):

in utf8: aÎda --> 41 c38e 44 41; aīda --> 41 c4ab 64 61 in cp1257: aīda --> 41 ee 64 61

php mysql encoding utf-8

Comments

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -