Page 1 of 1

chr() returns characters only in 1252 codepage

Posted: 07 Jan 2023 16:41
by DmFedorov
It seems to me that it is a bug that the characters of code pages with a number from 127-255 should be returned considering the system code page.
So for example all the letters of the Russian alphabet are placed in the range of 192-255
Instead of Russian letters the function outputs ASCII characters of code page 1252

Re: chr() returns characters only in 1252 codepage

Posted: 07 Jan 2023 19:47
by admin
There is an undocumented flag to mind the codepage. Try this:

Code: Select all

echo chr(255, 1);
It's been there since 20091219, but I haven't found time to document it yet. :)

Re: chr() returns characters only in 1252 codepage

Posted: 07 Jan 2023 20:03
by DmFedorov
It turns out that I was the first person in several years who decided to check this feature.
Thanks