Skip to content

Instantly share code, notes, and snippets.

@Yuichiroh
Last active August 29, 2015 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Yuichiroh/d9c78b117f5ab5ba6565 to your computer and use it in GitHub Desktop.
Save Yuichiroh/d9c78b117f5ab5ba6565 to your computer and use it in GitHub Desktop.
import java.nio.charset.CodingErrorAction
import scala.io.{Codec, Source}
object ReadAndWrite {
def main(args: Array[String]): Unit = {
implicit val codec = Codec("UTF-8")
codec.onMalformedInput(CodingErrorAction.REPLACE)
codec.onUnmappableCharacter(CodingErrorAction.REPLACE)
Source.fromInputStream(System.in).getLines().foreach(println)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment