dsj60862 2015-10-26 13:48
浏览 23

有没有办法直接在我的Mysql中修复编码问题?

I'm having an issue with my Wordpress install. Somehow all the content was inserted in the database with a wrong charset, but in the frontend is working smoothly.

As you can see here: http://prntscr.com/8vifc3

I'm changing my host, but when I imported my site won'r render the encoding properly because of the way that the content was inserted.

There's a way so I can fix the encoding directly in my previous mysql before I export it?

Thanks

  • 写回答

3条回答 默认 最新

  • duanpa1898 2015-10-26 13:56
    关注

    You can fix the issue by converting your strings to binary and then do charset conversion. The example below converts UTF8 data to CP1251:

    UPDATE table SET column=CONVERT(CONVERT(CONVERT(column USING binary) USING utf8) USING cp1251) WHERE id=123;
    
    评论

报告相同问题?