Re: Interpretation of non-UTF8 strings

[email protected] (Nick Ing-Simmons)
Newsgroups perl.unicode
Message-ID <[email protected]>
Dominic Mitchell <[email protected]> writes:
>Marcin 'Qrczak' Kowalczyk wrote:
>> This leaves chr() ambiguous, so there should be some other function for
>> making Unicode code points, as chr should probably be kept for
>> compatibility to mean the default encoding.
>
>In the past when I've needed to guarantee Unicode code points, I've used 
>  unpack("U",300).  chr() violates the principle of least astonishment 
>(for me anyway) by producing single byte output for input between 0x7f < 
>n < 0x100.

That is so legacy code that used chr() in non-ASCII locale "works"
same as it always did.
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.