perl-unicode

Re: Interpretation of non-UTF8 strings

2004-08-16 04:30:06
Nick Ing-Simmons wrote:
Dominic Mitchell <dom(_at_)semantico(_dot_)com> 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.

I realise that, it just took me by surprise because I was thinking in Unicode. In fact, I was making unwarranted assumptions.

-Dom

--
| Semantico: creators of major online resources          |
|       URL: http://www.semantico.com/                   |
|       Tel: +44 (1273) 722222 / Fax: +44 (1273) 723232  |
|   Address: 33 Bond St., Brighton, Sussex, BN1 1RD, UK. |

<Prev in Thread] Current Thread [Next in Thread>