{"id":1143,"date":"2011-02-01T21:51:29","date_gmt":"2011-02-01T21:51:29","guid":{"rendered":"http:\/\/thekua.com\/atwork\/?p=1143"},"modified":"2019-07-18T16:13:34","modified_gmt":"2019-07-18T14:13:34","slug":"utf-8-not-supported-by-resourcebundlemessagesource","status":"publish","type":"post","link":"https:\/\/thekua.com\/atwork\/2011\/02\/utf-8-not-supported-by-resourcebundlemessagesource\/","title":{"rendered":"UTF-8 not supported by ResourceBundleMessageSource"},"content":{"rendered":"<p>Every time I return to Java, I&#8217;m reminded by how hard simple things seem to be. Localisation is often quite important for applications, so I expected UTF-8 support out of the box with <a href=\"http:\/\/www.springsource.org\/\">Spring Framework<\/a> and Java via their <a href=\"http:\/\/static.springsource.org\/spring\/docs\/3.0.5.RELEASE\/javadoc-api\/org\/springframework\/context\/support\/ResourceBundleMessageSource.html\">ResourceBundleMessageSource<\/a> and standard <a href=\"http:\/\/download.oracle.com\/javase\/6\/docs\/api\/java\/util\/ResourceBundle.html\">ResourceBundle<\/a> classes. <\/p>\n<p>Things are never that simple as pointed out by the following articles:<\/p>\n<ul>\n<li><a href=\"https:\/\/web.archive.org\/web\/20160419110510\/http:\/\/osdir.com\/ml\/java.springframework.user\/2004-08\/msg00051.html\">Spring&#8217;s Juergen Hoeller on UTF-8 support and MessageSource<\/a><\/li>\n<li><a href=\"https:\/\/web.archive.org\/web\/20120830115156\/http:\/\/www.thoughtsabout.net:80\/blog\/archives\/000044.html\">Quick and dirty hack for UTF-8 support in Resource Bundle<\/a><\/li>\n<li><a href=\"https:\/\/web.archive.org\/web\/20130415215031\/http:\/\/www.kai-mai.com:80\/node\/128\">Loading resource bundle with UTF-8<\/a><\/li>\n<li><a href=\"https:\/\/web.archive.org\/web\/20130521203115\/http:\/\/bugs.sun.com\/view_bug.do;jsessionid=e32b38d72374d36f8ab679a0b44a?bug_id=4919638\">2003 bug on UTF-8 support in property files<\/a><\/li>\n<li><a href=\"http:\/\/forum.springsource.org\/archive\/index.php\/t-51074.html\">Solution for UTF-8 encoding problem inside property files<\/a><\/li>\n<li><a href=\"https:\/\/web.archive.org\/web\/20171012045846\/http:\/\/www.cakesolutions.net:80\/teamblogs\/2009\/04\/02\/utf-8-encoding-and-message-sources\">UTF-8 encoding and message sources<\/a><\/li>\n<\/ul>\n<p>Despite the poor documentation not noting this, there are work arounds described in the links above. Alternatives include using the, much longer named, <a href=\"http:\/\/static.springsource.org\/spring\/docs\/3.0.5.RELEASE\/javadoc-api\/org\/springframework\/context\/support\/ReloadableResourceBundleMessageSource.html\">ReloadableResourceBundleMessageSource<\/a> and <a href=\"http:\/\/download.oracle.com\/javase\/6\/docs\/api\/java\/io\/InputStreamReader.html#InputStreamReader(java.io.InputStream, java.lang.String)\">InputStreamReader<\/a> classes.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Every time I return to Java, I&#8217;m reminded by how hard simple things seem to be. Localisation is often quite important for applications, so I expected UTF-8 support out of the box with Spring Framework and Java via their ResourceBundleMessageSource and standard ResourceBundle classes. Things are never that simple as pointed out by the following [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14,4,35],"tags":[],"class_list":["post-1143","post","type-post","status-publish","format-standard","hentry","category-annoyances","category-development","category-java","post-preview"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>UTF-8 not supported by ResourceBundleMessageSource - patkua@work<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/thekua.com\/atwork\/2011\/02\/utf-8-not-supported-by-resourcebundlemessagesource\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"UTF-8 not supported by ResourceBundleMessageSource - patkua@work\" \/>\n<meta property=\"og:description\" content=\"Every time I return to Java, I&#8217;m reminded by how hard simple things seem to be. Localisation is often quite important for applications, so I expected UTF-8 support out of the box with Spring Framework and Java via their ResourceBundleMessageSource and standard ResourceBundle classes. Things are never that simple as pointed out by the following [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/thekua.com\/atwork\/2011\/02\/utf-8-not-supported-by-resourcebundlemessagesource\/\" \/>\n<meta property=\"og:site_name\" content=\"patkua@work\" \/>\n<meta property=\"article:published_time\" content=\"2011-02-01T21:51:29+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-07-18T14:13:34+00:00\" \/>\n<meta name=\"author\" content=\"Patrick\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@patkua\" \/>\n<meta name=\"twitter:site\" content=\"@patkua\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Patrick\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/2011\\\/02\\\/utf-8-not-supported-by-resourcebundlemessagesource\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/2011\\\/02\\\/utf-8-not-supported-by-resourcebundlemessagesource\\\/\"},\"author\":{\"name\":\"Patrick\",\"@id\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/#\\\/schema\\\/person\\\/c942203c9ed3ff9e21c6c49a996ea3ae\"},\"headline\":\"UTF-8 not supported by ResourceBundleMessageSource\",\"datePublished\":\"2011-02-01T21:51:29+00:00\",\"dateModified\":\"2019-07-18T14:13:34+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/2011\\\/02\\\/utf-8-not-supported-by-resourcebundlemessagesource\\\/\"},\"wordCount\":133,\"commentCount\":0,\"articleSection\":[\"Annoyances\",\"Development\",\"Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/thekua.com\\\/atwork\\\/2011\\\/02\\\/utf-8-not-supported-by-resourcebundlemessagesource\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/2011\\\/02\\\/utf-8-not-supported-by-resourcebundlemessagesource\\\/\",\"url\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/2011\\\/02\\\/utf-8-not-supported-by-resourcebundlemessagesource\\\/\",\"name\":\"UTF-8 not supported by ResourceBundleMessageSource - patkua@work\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/#website\"},\"datePublished\":\"2011-02-01T21:51:29+00:00\",\"dateModified\":\"2019-07-18T14:13:34+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/#\\\/schema\\\/person\\\/c942203c9ed3ff9e21c6c49a996ea3ae\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/2011\\\/02\\\/utf-8-not-supported-by-resourcebundlemessagesource\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/thekua.com\\\/atwork\\\/2011\\\/02\\\/utf-8-not-supported-by-resourcebundlemessagesource\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/2011\\\/02\\\/utf-8-not-supported-by-resourcebundlemessagesource\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"UTF-8 not supported by ResourceBundleMessageSource\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/#website\",\"url\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/\",\"name\":\"patkua@work\",\"description\":\"The intersection of technology and leadership\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/#\\\/schema\\\/person\\\/c942203c9ed3ff9e21c6c49a996ea3ae\",\"name\":\"Patrick\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2ef85a5f91c2aac13efb3ac90077b4db7f8883cafd6e60f2bcecba6b092d4011?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2ef85a5f91c2aac13efb3ac90077b4db7f8883cafd6e60f2bcecba6b092d4011?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2ef85a5f91c2aac13efb3ac90077b4db7f8883cafd6e60f2bcecba6b092d4011?s=96&d=mm&r=g\",\"caption\":\"Patrick\"},\"sameAs\":[\"http:\\\/\\\/thekua.com\\\/atwork\"],\"url\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/author\\\/patrick\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"UTF-8 not supported by ResourceBundleMessageSource - patkua@work","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/thekua.com\/atwork\/2011\/02\/utf-8-not-supported-by-resourcebundlemessagesource\/","og_locale":"en_US","og_type":"article","og_title":"UTF-8 not supported by ResourceBundleMessageSource - patkua@work","og_description":"Every time I return to Java, I&#8217;m reminded by how hard simple things seem to be. Localisation is often quite important for applications, so I expected UTF-8 support out of the box with Spring Framework and Java via their ResourceBundleMessageSource and standard ResourceBundle classes. Things are never that simple as pointed out by the following [&hellip;]","og_url":"https:\/\/thekua.com\/atwork\/2011\/02\/utf-8-not-supported-by-resourcebundlemessagesource\/","og_site_name":"patkua@work","article_published_time":"2011-02-01T21:51:29+00:00","article_modified_time":"2019-07-18T14:13:34+00:00","author":"Patrick","twitter_card":"summary_large_image","twitter_creator":"@patkua","twitter_site":"@patkua","twitter_misc":{"Written by":"Patrick","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/thekua.com\/atwork\/2011\/02\/utf-8-not-supported-by-resourcebundlemessagesource\/#article","isPartOf":{"@id":"https:\/\/thekua.com\/atwork\/2011\/02\/utf-8-not-supported-by-resourcebundlemessagesource\/"},"author":{"name":"Patrick","@id":"https:\/\/thekua.com\/atwork\/#\/schema\/person\/c942203c9ed3ff9e21c6c49a996ea3ae"},"headline":"UTF-8 not supported by ResourceBundleMessageSource","datePublished":"2011-02-01T21:51:29+00:00","dateModified":"2019-07-18T14:13:34+00:00","mainEntityOfPage":{"@id":"https:\/\/thekua.com\/atwork\/2011\/02\/utf-8-not-supported-by-resourcebundlemessagesource\/"},"wordCount":133,"commentCount":0,"articleSection":["Annoyances","Development","Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/thekua.com\/atwork\/2011\/02\/utf-8-not-supported-by-resourcebundlemessagesource\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/thekua.com\/atwork\/2011\/02\/utf-8-not-supported-by-resourcebundlemessagesource\/","url":"https:\/\/thekua.com\/atwork\/2011\/02\/utf-8-not-supported-by-resourcebundlemessagesource\/","name":"UTF-8 not supported by ResourceBundleMessageSource - patkua@work","isPartOf":{"@id":"https:\/\/thekua.com\/atwork\/#website"},"datePublished":"2011-02-01T21:51:29+00:00","dateModified":"2019-07-18T14:13:34+00:00","author":{"@id":"https:\/\/thekua.com\/atwork\/#\/schema\/person\/c942203c9ed3ff9e21c6c49a996ea3ae"},"breadcrumb":{"@id":"https:\/\/thekua.com\/atwork\/2011\/02\/utf-8-not-supported-by-resourcebundlemessagesource\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/thekua.com\/atwork\/2011\/02\/utf-8-not-supported-by-resourcebundlemessagesource\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/thekua.com\/atwork\/2011\/02\/utf-8-not-supported-by-resourcebundlemessagesource\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/thekua.com\/atwork\/"},{"@type":"ListItem","position":2,"name":"UTF-8 not supported by ResourceBundleMessageSource"}]},{"@type":"WebSite","@id":"https:\/\/thekua.com\/atwork\/#website","url":"https:\/\/thekua.com\/atwork\/","name":"patkua@work","description":"The intersection of technology and leadership","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/thekua.com\/atwork\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/thekua.com\/atwork\/#\/schema\/person\/c942203c9ed3ff9e21c6c49a996ea3ae","name":"Patrick","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/2ef85a5f91c2aac13efb3ac90077b4db7f8883cafd6e60f2bcecba6b092d4011?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/2ef85a5f91c2aac13efb3ac90077b4db7f8883cafd6e60f2bcecba6b092d4011?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2ef85a5f91c2aac13efb3ac90077b4db7f8883cafd6e60f2bcecba6b092d4011?s=96&d=mm&r=g","caption":"Patrick"},"sameAs":["http:\/\/thekua.com\/atwork"],"url":"https:\/\/thekua.com\/atwork\/author\/patrick\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/thekua.com\/atwork\/wp-json\/wp\/v2\/posts\/1143","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thekua.com\/atwork\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thekua.com\/atwork\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thekua.com\/atwork\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/thekua.com\/atwork\/wp-json\/wp\/v2\/comments?post=1143"}],"version-history":[{"count":8,"href":"https:\/\/thekua.com\/atwork\/wp-json\/wp\/v2\/posts\/1143\/revisions"}],"predecessor-version":[{"id":3415,"href":"https:\/\/thekua.com\/atwork\/wp-json\/wp\/v2\/posts\/1143\/revisions\/3415"}],"wp:attachment":[{"href":"https:\/\/thekua.com\/atwork\/wp-json\/wp\/v2\/media?parent=1143"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thekua.com\/atwork\/wp-json\/wp\/v2\/categories?post=1143"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thekua.com\/atwork\/wp-json\/wp\/v2\/tags?post=1143"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}