Melvyn Sopacua <[EMAIL PROTECTED]> wrote: > At 18:48 20-10-2002, Mike Robinson wrote: > >>Michael Mauch wrote: >> >> > I doubt that the C library does anything useful with >> > non-ASCII characters while you are in a "C" or "POSIX" >> > locale, so expat or PHP can't do much to correct that. >> > >> > So is your locale something other than "C" or "POSIX"? >> > "en_US.ISO-8859-1" for example? >> >>Yup, thats what its set to.
Hmm. Strange. What does php -r 'echo strtoupper("äöü"),"\n";' yield on your system? And what system is it, btw? >> > Perhaps ext/xml/tests/007.phpt could check whether it is able >> > to successfully use strtoupper() on $xmldata - and if not, >> > just skip that test? >> >>I have no problem with this test failing. It actually provides >>useful information. I'm not one to second-guess the intentions >>of the author of this test ('sniper' I think). > > But the reason for failure is not very clear, plus the manual > (http://www.php.net/manual/en/ref.xml.php#xml.case-folding) makes > no mention of the fact that it may fail and/or why. Yes, that's true. > Using non-ascii chars for tags, doesn't fall into the 'best practice' > category for me, but opinions differ :) > > We could make strtoupper locale aware, with an optional argument > "charset", but even then it can fail (tried it). Umm, strtoupper() _is_ locale aware, at least here (Linux, glibc-2.1.3): % php -r 'echo strtoupper("äöü"),"\n";' ÄÖÜ % LC_CTYPE=C php -r 'echo strtoupper("äöü"),"\n";' äöü We could use a test like strtopper("äöü")=="ÄÖÜ" to check if the system is able to handle these characters correctly. If not, the test could be skipped. Alas it's not possible to use setlocale() and set it to a 100% good locale with ISO-8859-1 characters - these bloody locales are different on each system, so you can only try and guess (of course you can do set right for your system(s), but not for _all_ systems). Obviously that problem has been addressed by a kind soul who implemented an array argument for setlocale() recently - see <http://www.php.net/manual/en/function.setlocale.php>. The user notes there are also very informative. > What would be nice - in general - is a "skip reason". Yes, true. Regards... Michael -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php