Spring MVC + Thymeleaf + HTML + JavaScriptでtwitterをGoogle Mapに表示するアプリを作っていたが、tweetをGoogle Mapのmarkerに表示したところmarkerに表示されるtweetの日本語が文字化けした。 以前、Thymeleafで文字化けした際は、servlet-context.xmlのorg.thymeleaf.templateresolver.ServletContextTemplateResolverとorg.thymeleaf.spring3.view.ThymeleafViewResolverの設定でcharacterEncodingを指定することで解消した。今回は既にその設定は済んでいる。 そこで一旦、(今回関係ない設定も含めて)文字化けに関係しそうな文字エンコーディング関連の箇所を整理してみた。 結論から
![本当に苦労したSpringでの文字化け問題 - 日常メモ](https://cdn-ak-scissors.b.st-hatena.com/image/square/9fde07ea7d744c2efc748aafaaa950c073cd1a55/height=288;version=1;width=512/https%3A%2F%2Fcdn-ak.f.st-hatena.com%2Fimages%2Ffotolife%2Fg%2FgraySpace%2F20140406%2F20140406124113.png)