title: Internationalization (locale) not working with accents in java spring boot
body: <p>I have a spring boot application where I use two languages English and French. I have my file messages.fr and messages.en as references to change the languages in the html documents with the help of thymeleaf.</p>
  
  <p>The problem that my accented stuff are looking like this:
  for example "Cr�er un compte" (create an account)
  It should be: "Créer un compte"</p>
  
  <p>What is the best way to go through this in spring boot? thank you for your help..</p>
  
  <p>keep in mind that I have this thymeleaf configuration inside my properties</p>
  
  <pre><code># INTERNATIONALIZATION (MessageSourceProperties)
  spring.messages.always-use-message-format=false
  spring.messages.basename=messages
  spring.messages.cache-duration=-1
  spring.messages.encoding=UTF-8
  spring.messages.fallback-to-system-locale=true
  
  #Thymeleaf configurations
  spring.thymeleaf.mode=LEGACYHTML5
  spring.thymeleaf.cache=false
  spring.thymeleaf.check-template=true
  spring.thymeleaf.check-template-location=true
  spring.thymeleaf.content-type=text/html
  spring.thymeleaf.enabled=true 
  spring.thymeleaf.encoding=UTF-8
  spring.thymeleaf.suffix=.html
  spring.thymeleaf.prefix=classpath:/templates/
  </code></pre>
  
  <p>I am using these beans in my configuration </p>
  
  <pre><code>@Bean
  public LocaleChangeInterceptor localeChangeInterceptor() {
      LocaleChangeInterceptor localeChangeInterceptor = new LocaleChangeInterceptor();
      LocaleChangeInterceptor.setParamName("lang");
      return localeChangeInterceptor;
  }
  
  @Bean
  public LocaleResolver localeResolver() {
      final CookieLocaleResolver cookieLocaleResolver = new CookieLocaleResolver();
      cookieLocaleResolver.setDefaultLocale(Locale.ENGLISH);
      return cookieLocaleResolver;
  }
  
  public void addInterceptors(InterceptorRegistry registry){
      registry.addInterceptor(localeChangeInterceptor());
  }
  </code></pre>
  
  <p>I run this code to test the content-type </p>
  
  <pre><code>@RequestMapping(value = "/check", method = RequestMethod.GET)
  @ResponseBody
  public String plaintext(HttpServletResponse response) {
      response.setContentType("text/plain");
      esponse.setCharacterEncoding("UTF-8");
      return "àèääèäé";
  }   
  </code></pre>
  
  <p>it returns the same value correclty: àèääèäé with accents</p>