Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re: How to remove wide chars (ex: 年 or 或) from a text file?

by davido (Archbishop)
on Mar 05, 2013 at 20:52 UTC ( #1021903=note: print w/replies, xml ) Need Help??

in reply to How to remove wide chars (ex: 年 or &#x6216) from a text file?

Do you want to remove any code point that is outside the range of normal ASCII text? Do you want to remove any HTML entity that translates to a code point beyond the ASCII range? Both of those could leave big holes in your text.

Or are you asking how to map code points that fall outside of the ASCII range into code points that fall within? If so, what mapping would you prefer? And how would you gracefully downgrade characters that don't have any obvious ASCII approximation?

As you begin to consider and answer (for yourself and for us) those questions, a solution will emerge.


  • Comment on Re: How to remove wide chars (ex: 年 or &#x6216) from a text file?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1021903]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2017-12-13 23:51 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (381 votes). Check out past polls.