Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^4: Mixed Unicode and ANSI string comparisons?

by Anonymous Monk
on Dec 15, 2015 at 01:15 UTC ( [id://1150319]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Mixed Unicode and ANSI string comparisons?
in thread Mixed Unicode and ANSI string comparisons?

No, as far as perl is concerned, you start with 4 Unicode strings and get 8 Unicode strings... in different storage formats. utf8 flag says pretty much nothing about "Unicodeness".
And now I remembered that LATIN_SMALL_LETTER_C_WITH_CEDILLA is codepoint 231 and you didn't use feature 'unicode_strings' (or, more commonly, use 5.012)... So yeah, you had 3 Unicode strings and 1 non-Unicode, "c" being Unicode (utf8 off), CEDILLA non-Unicode (utf8 on...) Interesting, isn't it? :)

Replies are listed 'Best First'.
Re^5: Mixed Unicode and ANSI string comparisons?
by choroba (Cardinal) on Dec 15, 2015 at 09:08 UTC
    Adding unicode_strings doesn't change the output in any way.
    ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,
      It doesn't change sort, but it would change some other operations though.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (7)
As of 2024-03-28 22:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found