{"id":4742,"date":"2012-04-30T16:04:17","date_gmt":"2012-04-30T21:04:17","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=4742"},"modified":"2012-04-30T16:37:45","modified_gmt":"2012-04-30T21:37:45","slug":"utf-8-everywhere","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2012\/04\/30\/utf-8-everywhere\/","title":{"rendered":"UTF-8 Everywhere"},"content":{"rendered":"<p><a href=\"http:\/\/www.utf8everywhere.org\">Pavel Radzivilovsky, Yakov Galka, and Slava Novgorodov<\/a> (via <a href=\"http:\/\/news.ycombinator.com\/item?id=3906253\">Hacker News<\/a>):<\/p>\n<blockquote cite=\"http:\/\/www.utf8everywhere.org\"><p>UTF-16 is the worst of both worlds&mdash;variable length and too wide. It exists for historical reasons, adds a lot of confusion and will hopefully die out.<\/p>\n<p>Portability, cross-platform interoperability and simplicity are more important than interoperability with existing platform APIs. So, the best approach is to use UTF-8 narrow strings everywhere and convert them back and forth on Windows before calling APIs that accept strings.<\/p><\/blockquote>\n<p>If you&rsquo;re a Cocoa programmer, be sure you&rsquo;re familiar with <code>-[NSString rangeOfComposedCharacterSequenceAtIndex:]<\/code>.<\/p>","protected":false},"excerpt":{"rendered":"<p>Pavel Radzivilovsky, Yakov Galka, and Slava Novgorodov (via Hacker News): UTF-16 is the worst of both worlds&mdash;variable length and too wide. It exists for historical reasons, adds a lot of confusion and will hopefully die out. Portability, cross-platform interoperability and simplicity are more important than interoperability with existing platform APIs. So, the best approach is [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"","apple_news_api_id":"","apple_news_api_modified_at":"","apple_news_api_revision":"","apple_news_api_share_url":"","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[],"class_list":["post-4742","post","type-post","status-publish","format-standard","hentry","category-programming-category"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/4742","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=4742"}],"version-history":[{"count":4,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/4742\/revisions"}],"predecessor-version":[{"id":4754,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/4742\/revisions\/4754"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=4742"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=4742"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=4742"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}