Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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

In reply to Re^2: Fixing suspect characters in HTML by wfsp
in thread Fixing suspect characters in HTML by wfsp

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2024-04-19 04:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found