title: Scala java.nio.charset.UnmappableCharacterException: Input length = 1
body: <p>I've found several questions with similar titles, but couldn't seem to use any to resolve my issue. I Can't seem to load my .csv file:</p>
  
  <pre><code>val source = io.Source.fromFile("C:/mon_usatotaldat.csv")
  </code></pre>
  
  <p>Returns:</p>
  
  <blockquote>
    <p>java.nio.charset.UnmappableCharacterException: Input length = 1</p>
  </blockquote>
  
  <p>So I tried:</p>
  
  <pre><code>val source = io.Source.fromFile("UTF-8", "C:/mon_usatotaldat.csv")
  </code></pre>
  
  <p>and got:</p>
  
  <blockquote>
    <p>java.nio.charset.IllegalCharsetNameException: C:/mon_usatotaldat.csv</p>
  </blockquote>
  
  <p>I guess UTF-8 wouldn't work, if the file isn't in UTF-8 format, so that makes sense, but I don't know what to do next.</p>
  
  <p>I've managed to discover the encoding is windows-1252 using:</p>
  
  <pre><code>val source = io.Source.fromFile("C:/mon_usatotaldat.csv").codec.decodingReplaceWith("UTF-8")
  </code></pre>
  
  <p>But this didn't do what I had expected, which was convert the file to UTF-8. I have no Idea how to work with it.</p>
  
  <p>Another thing I've tried was:</p>
  
  <pre><code>val source = io.Source.fromFile("windows-1252","C:/mon_usatotaldat.csv")
  </code></pre>
  
  <p>But that returned:</p>
  
  <blockquote>
    <p>java.nio.charset.IllegalCharsetNameException: C:/mon_usatotaldat.csv</p>
  </blockquote>
  
  <p>Please help. Thanks in advance.</p>