develooper Front page | perl.perl5.porters | Postings from February 2001

Re: The State of The Unicode

Simon Cozens
February 20, 2001 04:16
Re: The State of The Unicode
Message ID:
On Tue, Feb 20, 2001 at 11:43:30AM +0000, Nick Ing-Simmons wrote:
> No - you get the wrong answer. Consider a string which happens to be UTF-8
> encoded at time you do bytes::length - but which gets auto-downgraded 
> when you do the print

Yeah, well, that wasn't my idea either... :)

> , so you need
> { use bytes; print ... } 
> as well.

Or you set the output layer to UTF8, surely? But anyway, yes, you need to
explicitly tell Perl that you're outputting UTF8; if you don't do *that*, then
your program is broken as it won't be outputting what you want - if you do,
bytes::length will give you the right answer.

> bytes is (near) useless.

So we replace it with your utf8_length, which fills exactly the same
gap. Huh. Not convinced.

> But that does NOT mean that anything in bleadperl is broken.
You're right!

> Just that cutting a hole in ones abdomen and peering at ones guts
> is likely to hurt and not do you much good.
Well, hmm, Don't Do That Then. :)

void russian_roulette(void) { char *target; strcpy(target, "bullet"); } Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About