Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: incorrect length of strings with diphthongs

by jeffenstein (Hermit)
on Aug 25, 2022 at 14:04 UTC ( [id://11146413]=note: print w/replies, xml ) Need Help??


in reply to incorrect length of strings with diphthongs

You need to add 'use utf8;'

perl -we 'use Unicode::GCString;use Unicode::Normalize;$t="Hütte";prin +t length("$t");$g=Unicode::GCString->new("$t");print $g->columns' 66

perl -we 'use utf8;use Unicode::GCString;use Unicode::Normalize;$t="Hü +tte";print length("$t");$g=Unicode::GCString->new("$t");print $g->col +umns' 55

IIRC, the interpreter always uses ISO-8859-1 for the script unless you add 'use utf8;'

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2024-05-22 14:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found