title: Thymeleaf Map<String, Object> iteration and non-english chars in map key
body: <p>I have Spring, Thymeleaf, HTML5 web page. And have problem iterating through Map if map object contains non-english characters.</p>
  
  <ol>
  <li>All the character encoding filters/resolvers/converters are set and forced to UTF-8</li>
  </ol>
  
  <p>Let's say I have the following setup:</p>
  
  <p>Controller:</p>
  
  <pre><code>@RequestMapping(value = "/app", method =  { RequestMethod.GET, RequestMethod.POST })
  public String view(ModelMap model, @RequestParam(value = "foo", required = false) Integer foo) {
     MapDTO mapDto = new MapDTO();
     Map&lt;String, List&lt;Foo&gt;&gt; mapFoo ... // populate map etc.
     model.add("mapDto", mapDto.setMapFoo(mapFoo))
     return foo == null ? VIEW : VIEW + " :: fooFragment"
  }
  </code></pre>
  
  <p>And template for testing purposes:</p>
  
  <pre><code>.. page ..
  &lt;div th:fragment="fooFragment" id="fooFragment"&gt;
    ..
    &lt;th:block th:each="fooMap : ${mapDto.mapFoo}"&gt;
      &lt;th:block th:each="item,row : ${fooMap.value.fooList}"&gt;
        &lt;p th:text="${item.val}"&lt;/p&gt; &lt;!-- working OK --&gt;
        &lt;p th:text=" ${fooMap.value.fooList[__${row.index}__].idrValueName} "&gt;&lt;/p&gt; &lt;!-- working OK --&gt;
        &lt;input th:field="*{mapDto.mapFoo[__${fooMap.key}__].fooList[__${row.index}__].val} "&gt;&lt;/p&gt;&lt;!-- And this is working --&gt;
        &lt;p th:text="${mapDto.mapFoo[__${fooMap.key}__].fooList[__${row.index}__].val} "&gt;&lt;/p&gt;&lt;!-- FAILING ON THIS --&gt;
      &lt;/th:block&gt;
    &lt;/th:block&gt;
    ..
  &lt;/div&gt;
  .. rest of the page ..
  </code></pre>
  
  <p>Let's say, that i have map with keys "A" and "Ā".</p>
  
  <ol start="2">
  <li>I'm getting following exception:</li>
  </ol>
  
  <p><code>org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.thymeleaf.exceptions.TemplateProcessingException: Exception evaluating SpringEL expression: "mapDto.mapFoo[Ā].fooList[0].val"
  ..
  Caused by: 
  java.lang.IllegalStateException: Cannot handle (257) 'Ā'</code></p>
  
  <ol start="3">
  <li>Whats interesting - I have almost exactly the same setup on different page (A bit different mapDto structure and template, but the same principle, same page headers) and I don't have the same issues there.</li>
  <li>Maps that don't have keys with non-english characters behaves as predicted.</li>
  </ol>
  
  <p>Any ideas where lies the problem? </p>
  
  <p>SOLVED:
  Solved described issue using double-bracket syntax<br>
  <strong>${{...}}</strong><br>
  There are some limitations with it. But I was able to work around them it solved my main issue.</p>