Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (1)
As of 2018-01-17 22:05 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (206 votes). Check out past polls.