问题
I need to remove windows characters from a csv file before parsing into a database. These are characters like the "long hyphen" or "word inverted commas"
In php I can remove with mb_convert_encoding(), How can I do the same in perl ?
I need to remove only windows characters , not utf-8 characters
回答1:
The from_to() function from Encode seems to be a pretty close match for mb_convert_encoding().
But it sounds like you have a file where some of it is encoded in CP1252 and some of it is in UTF8. That seems strange and I'm not sure how you'd tell which bit of the file has each encoding.
来源:https://stackoverflow.com/questions/33216268/equivalent-for-mb-convert-encoding-in-perl