{"id":1054,"date":"2013-07-11T00:26:32","date_gmt":"2013-07-10T16:26:32","guid":{"rendered":"http:\/\/www.computersolutions.cn\/blog\/?p=1054"},"modified":"2013-07-11T00:26:32","modified_gmt":"2013-07-10T16:26:32","slug":"utf8-latin-1-hacky-fix-for-wordpress","status":"publish","type":"post","link":"https:\/\/www.computersolutions.cn\/blog\/2013\/07\/utf8-latin-1-hacky-fix-for-wordpress\/","title":{"rendered":"UTF8 LATIN-1 hacky fix for wordpress"},"content":{"rendered":"<p>Rather hacky fix to sort out utf8 latin-1 post issues after export from a rather badly encoded mysql db in wordpress.<\/p>\n<p><code>UPDATE wp_posts SET post_content = REPLACE(post_content, '\u00e2\u20ac\u0153', '\u201c');<br \/>\nUPDATE wp_posts SET post_content = REPLACE(post_content, '\u00e2\u20ac\u009d', '\u201d');<br \/>\nUPDATE wp_posts SET post_content = REPLACE(post_content, '\u00e2\u20ac\u2122', '\u2019');<br \/>\nUPDATE wp_posts SET post_content = REPLACE(post_content, '\u00e2\u20ac\u02dc', '\u2018');<br \/>\nUPDATE wp_posts SET post_content = REPLACE(post_content, '\u00e2\u20ac\u201d', '\u2013');<br \/>\nUPDATE wp_posts SET post_content = REPLACE(post_content, '\u00e2\u20ac\u201c', '\u2014');<br \/>\nUPDATE wp_posts SET post_content = REPLACE(post_content, '\u00e2\u20ac\u00a2', '-');<br \/>\nUPDATE wp_posts SET post_content = REPLACE(post_content, '\u00e2\u20ac\u00a6', '\u2026');<br \/>\n<\/code><\/p>\n<p>Not recommended, but I had a use for it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Rather hacky fix to sort out utf8 latin-1 post issues after export from a rather badly encoded mysql db in wordpress. UPDATE wp_posts SET post_content = REPLACE(post_content, &#8216;\u00e2\u20ac\u0153&#8217;, &#8216;\u201c&#8217;); UPDATE wp_posts SET post_content = REPLACE(post_content, &#8216;\u00e2\u20ac\u009d&#8217;, &#8216;\u201d&#8217;); UPDATE wp_posts SET post_content = REPLACE(post_content, &#8216;\u00e2\u20ac\u2122&#8217;, &#8216;\u2019&#8217;); UPDATE wp_posts SET post_content = REPLACE(post_content, &#8216;\u00e2\u20ac\u02dc&#8217;, &#8216;\u2018&#8217;); UPDATE wp_posts [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[4],"tags":[470,469,120],"class_list":["post-1054","post","type-post","status-publish","format-standard","hentry","category-useful-info","tag-latin1","tag-utf8","tag-wordpress"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/posts\/1054","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/comments?post=1054"}],"version-history":[{"count":1,"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/posts\/1054\/revisions"}],"predecessor-version":[{"id":1055,"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/posts\/1054\/revisions\/1055"}],"wp:attachment":[{"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/media?parent=1054"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/categories?post=1054"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/tags?post=1054"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}