Derick Rethans <[EMAIL PROTECTED]> wrote:
> On Mon, 21 Oct 2002, Melvyn Sopacua wrote:
> 
>> msopacua              Mon Oct 21 04:55:07 2002 EDT
>> 
>>   Modified files:              
>>     /php4/ext/xml/tests       007.phpt 
>>   Log:
>>   Skip this when strtoupper doesn't behave as expected, because casefolding
>>   depends on this.
> 
> erm, this is just a local problem. Just set the locale to "German" here 
> and it will work just fine I think. IMO this is a hack :)

The problem is that there are an awful lot of "German" locales.

Something like

  setlocale(LC_ALL,array('de_DE.ISO8859-1','de_DE.ISO8859-15',
                         'de_DE@euro','de','de_DE'));

and some more variations with "-" or "_" after the "ISO", or even "DIS"
instead of "ISO", might work for most platforms that have a German
locale installed. But because some systems don't have a German locale at
all (IIRC on Debian you have to install your locales explicitly and run
locale-gen afterwards), "en_US" and it's variations might be more
promising:

foreach(array('','_','-') as $hyphen)
  foreach(array('ISO','DIS') as $ISODIS)
    $locales[] = "en_US.${ISODIS}${hyphen}8859-1\n";
$locales[] = 'en_US@euro';
$locales[] = 'en_US';
$locales[] = 'en';
setlocale(LC_ALL,$locales);

Nice, isn't it?

There's a good page about that at
<http://www.uni-ulm.de/~s_smasch/locale/> (in English). There's also a
small C program called "checklocale".                                   

But even if we use such a locale guessing: it's not the fault of the XML
code if non-ASCII characters don't work. It might be a good idea to have
a seperate test case for strtoupper() etc., but for testing the XML
extension, I still think that's it's better to just bail out as soon as
we see that strtoupper() doesn't behave.

Maybe we should add

  setlocale(LC_ALL,'');

at the beginning of ext/xml/tests/007.phpt to make sure that the locale
settings of the environment are used (although here the values of the
environment are used even without that statement).

Regards...
                Michael

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to