Can I Convert this utf8 Character?

拜拜、爱过 提交于 2019-12-12 05:39:33

问题


I am using dom htm document function to scrape html and store it into MySQl. but I have notieced that for foriegn languages like chinese or japanese etc. some wierd charactors are stored in MySQL and I dont think any one can read this..,门户,新闻,ータル,検索

so my question is can I convert this back into original form by using any code??

if not I want to eliminate this from my table beacuse there is no use of it.how can I eliminate only these charactors from table??


回答1:


This should do the trick if the input is actually UTF-8:

echo iconv('UTF-8', 'ASCII//IGNORE', 'news,门户,æ–°é—»,portal,网易,163,china,门户ç');



回答2:


Best way is to store this data after doing base64 encoding

1.) UNICODE TO UTF8

2.) UTF8 TO BASE64



来源:https://stackoverflow.com/questions/4815714/can-i-convert-this-utf8-character

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