Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re: UTF-8 and browsers - Update

by dakkar (Hermit)
on Feb 14, 2005 at 12:39 UTC ( #430763=note: print w/replies, xml ) Need Help??

in reply to UTF-8 and browsers - Update

Bug in Firefox. It should work as you describe.

As for the composition: first of all, work on characters, or at least or codepoints, not on utf-8 bytes. Second, you want Unicode Normal Form C (see Unicode::Normalize), so that you can write:

use Unicode::Normalize; use charnames ':full'; # this is just to make things easier in this ex +ample binmode(STDOUT,':utf8'); # this to make 'print' output utf-8 bytes my $a="O\N{COMBINING DIAERESIS}"; my $b=NFC($a); print length($a),$a,"\n"; print length($b),$b,"\n";

Will print:

2Ö 1

(more or less, depending on PM's escaping mechanisms)

        dakkar - Mobilis in mobile

Most of my code is tested...

Perl is strongly typed, it just has very few types (Dan)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://430763]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2016-10-25 06:32 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (315 votes). Check out past polls.