equivalent for mb_convert_encoding() in perl

☆樱花仙子☆ 提交于 2020-01-25 00:31:07

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!