Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^3: Mixed Unicode and ANSI string comparisons?

by choroba (Cardinal)
on Dec 14, 2015 at 23:47 UTC ( [id://1150305]=note: print w/replies, xml ) Need Help??


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

Plain "c" in ASCII is indistinguishable from the "c" in UTF-8. In fact, all the 7-bit ASCII are part of the UTF-8.
($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,

Replies are listed 'Best First'.
Re^4: Mixed Unicode and ANSI string comparisons?
by BrowserUk (Patriarch) on Dec 15, 2015 at 01:17 UTC
    Plain "c" in ASCII is indistinguishable from the "c" in UTF-8.

    I thought that the utf flag would distinguish strings that you've asked to be utf8 encoded; from those you haven't. Even if they both contain the same 7-bit codes.

    If that's not the case; perl's Unicode support is even more broken than I thought.

    In fact, all the 7-bit ASCII are part of the UTF-8.

    And if the non-Unicode strings contain 8-bit chars?


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
    In the absence of evidence, opinion is indistinguishable from prejudice.
      And if the non-Unicode strings contain 8-bit chars?
      That's what I tried to demostrate with the encode, but apparently failed. The utf flag is an internal thing, you shouldn't care about it. If you're getting strings of mixed encodings from the data, fix the data or the input routines to unify the encoding.
      ($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,
        fix the data

        Right!


        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
        In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (3)
As of 2024-03-29 07:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found