Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: validating unicode chars in their smallest form

by ikegami (Patriarch)
on Jun 13, 2010 at 18:23 UTC ( [id://844464]=note: print w/replies, xml ) Need Help??


in reply to validating unicode chars in their smallest form

Hmm that seems like it might address a slightly different issue, but I will read more about that.

Compare www.paypаl.com vs www.paypal.com. On this computer, it's impossible to tell that the two strings are different by looking at them. On another computer, it's very hard.

This is concern #1 of mine Using UTF-8 Encoding to Bypass Validation Logic

This has nothing to do with Unicode. It's strictly a UTF-8 problem. Since you should decode text before working with it, there's no problem.

Take U+00C9. It could be encoded as

C3 89
or as
E0 83 89

If you work with the characters in their encoded form, they appear to be two different characters. Once you decode them, you're only dealing with character U+00C9. There's no problem if your decoder works properly.

(A quick test shows that Encode only accepts the shortest form. The longer forms are treated as invalid. That's good.)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://844464]
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: (5)
As of 2025-07-11 11:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.