Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: Fixing suspect characters in HTML

by wfsp (Abbot)
on Jul 30, 2005 at 16:18 UTC ( [id://479619]=note: print w/replies, xml ) Need Help??


in reply to Re: Fixing suspect characters in HTML
in thread Fixing suspect characters in HTML

Thanks for your response.

For me, your string returned:

93 64 6f 75 62 6c 65 94 d1 20 d2 201c 64 6f 75 62 6c 65 201d 2018 73 69 6e 67 6c 65 2019
xd1 and xd2 are outside the range being checked (x80-x9F), are legal unicode (the cp1252/unicode chart gives the same codes) and encode_entities returned (as you found):
Ñ Ò
Note that, for example, ’ returned x2019 so wouldn't be mucked about by the cp1252 replacement.

The comment in the script:

# "replaces HTML entities... # with the corresponding Unicode character"
is from the H::E doc and had more significance than I first realised.

__But__ I too am surprised it appears to work. I wrote quite a bit of code to process utf8 and was almost a bit miffed that it seemed unnecessary!

This my first outing in these waters so will be pleased to be corrected if I've got any of this tangled up.

Again, thanks for your comments,
John

unicode.org cp1252 chart

update:

Extract from the chart:

cp1252 unicode 0xD1 0x00D1 #LATIN CAPITAL LETTER N WITH TILDE 0xD2 0x00D2 #LATIN CAPITAL LETTER O WITH GRAVE

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://479619]
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: (4)
As of 2024-04-20 15:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found