Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (2)
As of 2016-10-24 04:36 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (302 votes). Check out past polls.