Friday, April 20, 2012

Gettext on php/iis/win7, wrong charset

I am refactoring some old app in php 5.2.17 and converting it to UTF-8 charset. App uses gettext, but for some reason, gettext returns data in cp1250 (on win7 witch czech national environment) even if all texts are now UTF-8 and catalog texts too. I did try to create one brand new in UTF-8 from beginning, restarting IIS7.5, but still getting wrong charset (not UTF-8 but cp1250). (I am new in win7, on new pc, maybe it is in some php config, mbstring and iconv has set UTF-8 as internal encoding)



Edit:
This is header of my .po file.I generating .mo every time again:



"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Poedit-KeywordsList: _;gettext;gettext_noop\n"
"X-Poedit-Basepath: ../../../\n"
"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"
"X-Poedit-Language: Czech\n"
"X-Poedit-Country: CZECH REPUBLIC\n"
"X-Poedit-SourceCharset: utf-8\n"
"X-Poedit-SearchPath-0: .\n"


All codes and html header is now utf-8. What about any IIS chache? But restart of IIS hase no efect.



Do you have any idea what can be wrong?
Thank you for answer.





No comments:

Post a Comment