in reply to Re: Fixing suspect characters in HTML
in thread Fixing suspect characters in HTML
For me, your string returned:
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):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
Note that, for example, ’ returned x2019 so wouldn't be mucked about by the cp1252 replacement.Ñ Ò
The comment in the script:
is from the H::E doc and had more significance than I first realised.# "replaces HTML entities... # with the corresponding Unicode character"
__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
update:
Extract from the chart:
cp1252 unicode 0xD1 0x00D1 #LATIN CAPITAL LETTER N WITH TILDE 0xD2 0x00D2 #LATIN CAPITAL LETTER O WITH GRAVE
|
|---|