1) sorry I am compelled to change the subject so all threads don’t look the 
same.

2) It's a no-win situation. If we don't make the functions provide reasonable 
behavior for unicode, then every program needs to be rewritten to change 
function names.
The number of places where hard coded constants (6) are used is probably much 
smaller.

At least this way most code does the right thing as-is.

Also, if you don't want functions to show unicode behavior, leave unicode off, 
and just convert the data to utf-8.

We do need to have functions that provide the raw byte length, so it will be 
available.

Tex Texin
Internationalization Architect,   Yahoo! Inc.
 
 


> -----Original Message-----
> From: Makoto Tozawa [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, August 24, 2005 7:41 PM
> To: Andrei Zmievski
> Cc: [EMAIL PROTECTED]; PHP Developers Mailing List
> Subject: Re: [PHP-DEV] Re: PHP Unicode support design document
> 
> 
> Andrei Zmievski wrote:
> 
> >> Is there any way to keep the byte semantics (in oppose to unicode
> >> semantics)
> >> only for the existing functions? For example, the Oracle 8 
> functions 
> >> can be
> >> configured to use utf-8 for the character encoding of strings. In 
> >> order for
> >> them to work properly, fundamental functions, which Oracle 
> 8 function 
> >> call,
> >> have to behave in byte samentics. And if they work 
> properly when the 
> >> unicode
> >> semantics switch is turned on, by setting the 
> runtime_encoding to utf-8,
> >> they can be called by uncode applications.
> >
> > I couldn't parse this on the first try. Could you restate this?
> 
> Say there is a function which calls strlen($s) expecting it 
> returns byte 
> size of $s,
> and it is working fine when $s constains multibyte 
> characters. For example, the function expects strlen('áéí') 
> returns 6 when the encoding is utf-8. If this function is 
> called by Uniocde ready applications on 
> Unicode-enabled PHP,
> it will fall into error because strlen('áéí') will return 3.
> 
> Is there any way to let strlen('áéí') return 6 only when it 
> is called by 
> the existing function?
> 
> Hope I explained well this time.
> 
> Makoto
> 
> -- 
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 

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

Reply via email to