Post Russian characters
I have a small script which works just fine it displays a calendar, however someone downloaded it and wants to use it in Russian, here is a link to a demo site the calendar is on the left, if you notice the calendar is displayed just fine at first, however if you skip a month or a year then on update the calendar will display unknown symbols, is there something special that needs to be done to the file in order for it to work?
The problem is that the day initials are sent on post
The calendar works fine if language is set to English.
var dayInitials99 = "ПВСЧПСВ"
What I did to fix this was replace dayInitials99 = "ПВСЧПСВ" for dayInitials99 = "П|В|С|Ч|П|С|В" and use explode instead of str_split
The reason you had issues is due to str_split is not multibyte safe.
In short, this means that it can potentially split multibyte characters "in the middle" i.e. after 7 bit instead after 16 bit.
When working with multibyte languages make certain you use the mb_ string functions, or enable it in the php.ini file so it automatically use it when available.
In your case, you would need to use mb_split, though its slightly different since this one is based on a regex, so you would need to tell it where to split.
Thank you, I have just learned that the string functions I was using would not work for some languages and since I am trying to target that public I will be more careful in the future
Originally Posted by TheRedDevil