grs84pl Wrote:To be honest,
Problem with encoding in month name it's not really a problem.
everywhere where i find 'strftime', I'm put:
Code:iconv("ISO-8859-2","UTF-8",ucfirst(strftime($format,$timestamp)))
But i didn't yet get a proper working timezones. All my events are 1 day early than it should be.
But still working!
I've just realized than there's no need for me to change any strftime occurence to the code above.
Setting
Code:
setlocale(LC_ALL, 'pl_PL.UTF8','pl.UTF8','pl_PL','pl');
There's another with the use of utf8_encode() PHP function used while the event content saving.
As written on php.net function description:
Quote:Please note that utf8_encode only converts a string encoded in ISO-8859-1 to UTF-8. A more appropriate name for it would be "iso88591_to_utf8". If your text is not encoded in ISO-8859-1, you do not need this function. If your text is already in UTF-8, you do not need this function. In fact, applying this function to text that is not encoded in ISO-8859-1 will most likely simply garble that text.So when I'm using Polish language and got ISO-8859-2 or UTF-8 encoding out of the New Event form - utf8_encode() completely garble it before saving to XML file.
The same is happening when outputting calendar month names.
Anyway I still do have issue the event added on 8 Sep is showed properly in calendar (8 Sep) and in Event Edit Form in Admin Panel, but as an output from upcoming_events(null, null); function appears the day before its real schedule (7 Sep).
EDIT: I have quickly experiment with different setlocale parameters (for Polish language) and there are results:
- pl_PL.UTF8 - correct (Polish) month names with correct encoding
- pl_PL - correct (Polish) month names with incorrect encoding (ISO-8859-2)
- pl.UTF8 - incorrect (English) month names - no idea about encoding
- pl - as just above
BTW: As I understand definitions - 'pl' (or maybe 'pl.UTF8') code should be enough for specifying Polish locale, but it isn't. I don't know why. Reading different decriptions of ISO, RFC and so on I wonder why setlocale doesn't work with "canonical" code 'pl-PL' but works with "non-canonical" code 'pl_PL'.