title: SimpleDateFormat Illegal pattern character error with localized pattern
body: <p>I'm trying to understand some SimpleDateFormat code. In particular I'm trying to use localized pattern strings in SimpleDateFormat. From the <a href="https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html">javadoc</a>:</p>
  
  <blockquote>
    <p>SimpleDateFormat also supports localized date and time pattern strings. In these strings, the pattern letters described above may be replaced with other, locale dependent, pattern letters.</p>
  </blockquote>
  
  <p>It also specifies a <code>SimpleDateFormat(String pattern, DateFormatSymbols formatSymbols)</code> constructor:</p>
  
  <blockquote>
    <p>Constructs a SimpleDateFormat using the given pattern and date format symbols.</p>
  </blockquote>
  
  <p>However, although <code>getLocalPatternChars()</code> instance is presenting the expected pattern characters, SimpleDateFormat's constructors are rejecting patterns containing those characters:</p>
  
  <pre><code>public void run() {
      Locale loc = new Locale("de", "de");
      DateFormatSymbols dfs = new DateFormatSymbols(loc);
      String sym = dfs.getLocalPatternChars();
      System.out.println(sym);
      SimpleDateFormat datefmt = new SimpleDateFormat("tt.MM.uuuu", dfs);
  }
  </code></pre>
  
  <p>produces output:</p>
  
  <pre><code>GuMtkHmsSEDFwWahKzZ
  Exception in thread "main" java.lang.IllegalArgumentException: Illegal pattern character 't'
      at java.text.SimpleDateFormat.compile(SimpleDateFormat.java:845)
      ...
  </code></pre>
  
  <p>I get the same output if I replace the last line with "<code>... new SimpleDateFormat("tt.MM.uuuu", loc);</code>".</p>
  
  <p>On the other hand, if I create a SimpleDateFormat instance using any Anglicized pattern string, then call "<code>applyLocalizedPattern("tt.MM.uuuu")</code>", the localized pattern is accepted.</p>
  
  <p>So it appears that one cannot use a localized pattern string in SimpleDateFormat's constructors, and need this two-step initialization. Is this intentional behaviour?</p>