Desktop Thatâ<U+0080><U+0099>s More Elegant Which should look like this instead:

Desktop That’s More Elegant

You know, in HTML, it is possible to insert codes that produce UTF characters on the screen, and they exist in case you want the source code to be simple ASCII characters only. No UTF. I prefer that, because as you said, the UTF characters can mess up the code. For example, the above text should be:

Desktop That&rsquo;s More Elegant

How to encode UTF characters in HTML

If I had the same problem, I would write a perl sub that replaces all these specific characters with the HTML equivalent first, and then just remove all 00 characters from the entire text and deal with the spaces and line breaks last.


In reply to Re: Safely removing Unicode zero-width spaces and other non-printing characters by harangzsolt33
in thread Safely removing Unicode zero-width spaces and other non-printing characters by mldvx4

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.