I have been using iconv
to convert data from my company's database (windows-1250
) to UTF8
. It all worked fine until recently.
I'm not really sure what happened, as I've noticed the change only recently. The problem is that iconv
seems to stop working well - it still throws notices when I use bad encoding name.
Earlier, when I saved a string to the db with
htmlspecialchars(iconv('UTF-8', 'windows-1250', $string), ENT_QUOTES)
it was fine. Now only question marks are written to my db instead of e.g. ąęś
.
When I correct them via PL/SQL Developer
and read them via php: htmlspecialchars_decode(iconv('windows-1250', 'UTF-8', $string), ENT_QUOTES)
I receive aes
. I tried to set the encoding in php, right before string output:
header('Content-Type: text/html; charset=utf-8');
, but it didn't help.
My software is:
PHP 5.3.15 (cli)
iconv (GNU libc) 2.15
Apache/2.2.22
openSUSE 12.2
Oracle 10.2.0.4
oci