title: Greek String doesn't match regex when read from keyboard
body: <pre><code>public static void main(String[] args) throws IOException {
     String str1 = "ΔΞ123456";
     System.out.println(str1+"-"+str1.matches("^\\p{InGreek}{2}\\d{6}")); //ΔΞ123456-true
  
     BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
     String str2 = br.readLine(); //ΔΞ123456 same as str1.
     System.out.println(str2+"-"+str2.matches("^\\p{InGreek}{2}\\d{6}")); //Ξ”Ξ�123456-false
  
     System.out.println(str1.equals(str2)); //false
  }
  </code></pre>
  
  <p>The same String doesn't match regex when read from keyboard.<br>
  What causes this problem, and how can we solve this?<br>
  Thanks in advance.  </p>
  
  <p>EDIT:  I used System.console() for input and output.</p>
  
  <pre><code>public static void main(String[] args) throws IOException {
          PrintWriter pr = System.console().writer();
  
          String str1 = "ΔΞ123456";
          pr.println(str1+"-"+str1.matches("^\\p{InGreek}{2}\\d{6}")+"-"+str1.length());
  
          String str2 = System.console().readLine();
          pr.println(str2+"-"+str2.matches("^\\p{InGreek}{2}\\d{6}")+"-"+str2.length());
  
          pr.println("str1.equals(str2)="+str1.equals(str2));
  }
  </code></pre>
  
  <p>Output:  </p>
  
  <blockquote>
    <p>ΔΞ123456-true-8<br>
    ΔΞ123456<br>
    ΔΞ123456-true-8<br>
    str1.equals(str2)=true</p>
  </blockquote>