title: Does the Scala compiler work with UTF-8 encoded source files?
body: <p>I have a very simple bit of Scala code </p>
  
  <pre><code> var str = "≤"
   for( ch &lt;- str ) { printf("%d, %x", ch.toInt, ch.toInt) ; println  }
   println
   str = "\u2264" ;
   for( ch &lt;- str ) { printf("%d, %x", ch.toInt, ch.toInt) ; println }
  </code></pre>
  
  <p>In case that doesn't show properly on your browser, the first string contains one character, between double-quotes, which is the less-or-equal-to sign U+2264.</p>
  
  <p>The program outputs</p>
  
  <pre><code>8218, 201a
  226, e2
  167, a7
  
  8804, 2264
  </code></pre>
  
  <p>Clearly the first string is 3 characters long at run time, not 1 character long as it is in the source file. </p>
  
  <p>The source file is stored in UTF-8.  A hex dump shows that it is encoded properly, the first string being  22 E2 89 A4 22.  I'm using Eclipse and the Scala plugin for Eclipse.</p>
  
  <ul>
  <li><strong>Does the scala compiler accept input files encoded in UTF-8?</strong></li>
  <li><strong>If so, why does my program produce unexpected results?</strong></li>
  </ul>