php - How to know which characterset is in text field in MySql database if I know only that text -
problem begin when change php ver 5.3 (5.4., 5.5, 5.6)
i have in table text :
$rus3="Ð’Ñ‹ не хватает путевок. ДоплачиваетÑÑ. Ðажмите ok и выберите нужный пакет ...";
i have need convert lots of text in readable table under utf8
then use:
$rust3=iconv("utf-8","windows-1252//ignore",$rus3);
and on russian cyrilic this:
rust3: Вы не хватает путевок. Доплачивает��. �ажмите ok и выберите нужный пакет ...
but not characters transform , , characters not convert parameters of function iconv . have more 4 language special characters deppending of language in database fields, whot must convert visible , legible .
how can know in character set text, if have text ( simbols ) , how best way convert in utf8. when sql command in mysql database character set show in utf8.
you can try
$str = "bla bla bla"; echo mb_detect_encoding($str);
will give char set
how ever check charset of mysql db can use
mysql_client_encoding($conn);
so per question can try
echo mb_convert_encoding($rus3, "utf8", "auto");
instead iconv. if helps check more mb_convert_encoding
Comments
Post a Comment