Re: [PHP-I18N] what is the encoding of Zval IS_STRING for string literals when unicode.semantics=off

[email protected] (Norbert Lindenberg)
Newsgroups php.i18n
Message-ID <[email protected]>
Hi Makoto,

The specification is pretty clear that unicode.semantics=off means  
binary strings. But the specification leaves the possibility open  
that, if you set unicode.script_encoding (or the encoding pragma) and  
the unicode.runtime_encoding to different encodings, the PHP runtime  
would convert the string literals from one encoding in your source  
files to a different encoding in the runtime. The strings would still  
be binary at runtime, but a different byte sequence than in the  
source file. Such a behavior could be seen as compatible with PHP 5  
because the default settings for unicode.script_encoding and  
unicode.runtime_encoding are both UTF-8.

I would guess that the team hasn't thought of that interpretation,  
that they really mean it when they say "if unicode.semantics is off,  
PHP behaves as it did in the past," and that unicode.script_encoding  
and the encoding pragma are totally ignored if unicode.semantics is  
off. But it would be good to clarify this in the specification.

Regards,
Norbert


On Feb 8, 2007, at 16:14 , Makoto Tozawa wrote:

> Hello,
>
> When the unicode.semantics=off, in what encoding will the PHP 6  
> engine create Zval IS_STRING for the string literals?
> I can think of two possibilities.
>
> 1. PHP 6 does the same as PHP 5 because unicode.semantics=off means  
> backwards compatibility. Thus they are binary data.
> 2. PHP 6 respects the unicode.script_encoding (or the encoding  
> pragma) and the unicode.runtime_encoding. Thus they are in  
> unicode.runtime_encoding.
>
> Thank you,
> Makoto
>
> -- 
> PHP Unicode & I18N Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

-------------------------------------
Norbert Lindenberg
Yahoo! Internationalization Architect
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.