Scala has built in support for this.

Should be able to get it into a one-liner:

http://stackoverflow.com/questions/1757272/how-to-resolve-java-nio-charset-unmappablecharacterexception-in-scala-2-8-0