问题
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