How to resolve java.nio.charset.UnmappableCharacterException in Scala 2.8.0?

Posted by Roman Kagan on Stack Overflow See other posts from Stack Overflow or by Roman Kagan
Published on 2009-11-18T16:31:46Z Indexed on 2010/04/28 1:03 UTC
Read the original article Hit count: 687

Filed under:

I'm using Scala 2.8.0 and trying to read pipe delimited file like in code snipped below:

object Main {
  def main(args: Array[String]) :Unit = {
    if (args.length > 0) {
      val lines ="QUICK!LRU-2009-11-15.psv")
     for (line <-lines)

Here's the error:

Exception in thread "main" java.nio.charset.UnmappableCharacterException: Input length = 1 at java.nio.charset.CoderResult.throwException( at sun.nio.cs.StreamDecoder.implRead( at at at at at$$anonfun$1$$anonfun$apply$1.apply(BufferedSource.scala:29) at$$anonfun$1$$anonfun$apply$1.apply(BufferedSource.scala:29) at at$$anonfun$1.apply(BufferedSource.scala:29) at$$anonfun$1.apply(BufferedSource.scala:29) at scala.collection.Iterator$$anon$ at scala.collection.Iterator$$anon$ at scala.collection.Iterator$$anon$2.head(Iterator.scala:732) at scala.collection.Iterator$$anon$24.hasNext(Iterator.scala:405) at scala.collection.Iterator$$anon$20.hasNext(Iterator.scala:320) at at scala.collection.Iterator$class.foreach(Iterator.scala:534) at ... at infillreports.Main$.main(Main.scala:8) at infillreports.Main.main(Main.scala) Java Result: 1

© Stack Overflow or respective owner

Related posts about scala

Related posts about error