{"id":16945,"date":"2021-12-01T08:02:42","date_gmt":"2021-12-01T13:02:42","guid":{"rendered":"https:\/\/scruss.com\/blog\/?p=16945"},"modified":"2023-11-08T21:41:28","modified_gmt":"2023-11-09T02:41:28","slug":"i-u1f494-broken-heart-utf-8","status":"publish","type":"post","link":"https:\/\/scruss.com\/blog\/2021\/12\/01\/i-u1f494-broken-heart-utf-8\/","title":{"rendered":"I (U+1F494, BROKEN HEART) UTF-8"},"content":{"rendered":"\n<p>Something has gone very wrong with the database encoding on this blog after a recent update, so all my lovely UTF-8 characters have gone <a href=\"https:\/\/en.wikipedia.org\/wiki\/Mojibake\"><em>mojibake<\/em><\/a>.<\/p>\n\n\n\n<p>Trying to find ways to fix it. It may have to be manual. Remember, kids: <em>have backups before letting WordPress upgrade!<\/em><\/p>\n\n\n\n<p>Here&#8217;s the Python equivalent of what I think the database has done:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">bytes(\"I ???? UTF-8\", encoding='utf-8').decode(encoding='cp1252')\n'I \u00f0\u0178\u2019\u201d UTF-8'<\/pre>\n\n\n\n<p>Quite why my hosting thought a character encoding from last century was appropriate, I&#8217;ll never know.<\/p>\n\n\n\n<p><strong>Update, November 2023<\/strong>: kinda-sort fixed the backend, but the encoding is still weird \u2014 <a href=\"https:\/\/scruss.com\/blog\/2023\/11\/08\/can-we\/\">can we\u2026?<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Something has gone very wrong with the database encoding on this blog after a recent update, so all my lovely UTF-8 characters have gone mojibake. Trying to find ways to fix it. It may have to be manual. Remember, kids: have backups before letting WordPress upgrade! Here&#8217;s the Python equivalent of what I think the [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"I (U+1F494, BROKEN HEART) UTF-8: my WordPress blog's encoding has gone all funny and I may not be able to fix it","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[7],"tags":[50,3227,2425,638,49],"class_list":["post-16945","post","type-post","status-publish","format-standard","hentry","category-computers-suck","tag-blog","tag-dammit","tag-encoding","tag-unicode","tag-wordpress"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pQNZZ-4pj","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts\/16945","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/comments?post=16945"}],"version-history":[{"count":4,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts\/16945\/revisions"}],"predecessor-version":[{"id":17459,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts\/16945\/revisions\/17459"}],"wp:attachment":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/media?parent=16945"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/categories?post=16945"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/tags?post=16945"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}