|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2005-05-05 17:34 UTC] kirchner at cm-sec dot cz
Description: ------------ Functions "strtolower" and "strtoupper" do not convert some Czech characters from 8859-2 charset. I tested it and I found, that these functions do not convert characters "?"/"?", "?"/"?" and "?"/"?", but other special Czech characters are converted correctly. Remark: We most often use two charsets in our country: ISO 8859-2 for Unix like systems and CP1250 (windows-1250) for Windows systems. Special Czech characters have the same hexadecimal value in both charsets except of mentioned characters (?,?,?,?,?,?). I thing, that my locale is set correctly. Here are three rows from output of the phpinfo() function. default_charset ISO-8859-2 ISO-8859-2 _ENV["LC_ALL"] cs_CZ _ENV["LANG"] cs_CZ Best regards Jan Kirchner PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 30 18:00:01 2025 UTC |
Sounds like a locale bug to me. Could you compile this test program? #include <stdio.h> #include <locale.h> char *php_strtoupper(char *s, size_t len) { unsigned char *c, *e; c = s; e = c+len; while (c < e) { *c = toupper(*c); c++; } return s; } main(void) { char str[2]; str[0] = 0xb9; str[1] = 0x0; setlocale(LC_ALL,"cs_CZ"); puts(php_strtoupper(str,1)); } Just save it to s.c, for example and type: make s Then run it like this: ./s | od -x And add the output here. As far as I can tell 0xb9 gets uppercased to 0xa9 in 8859-2, so you should be seeing an a9 there in the output if your system's locale is working correctly.