{"action":"created","issue":{"url":"https://api.github.com/repos/scoverage/scalac-scoverage-plugin/issues/134","labels_url":"https://api.github.com/repos/scoverage/scalac-scoverage-plugin/issues/134/labels{/name}","comments_url":"https://api.github.com/repos/scoverage/scalac-scoverage-plugin/issues/134/comments","events_url":"https://api.github.com/repos/scoverage/scalac-scoverage-plugin/issues/134/events","html_url":"https://github.com/scoverage/scalac-scoverage-plugin/issues/134","id":108112851,"number":134,"title":"java.nio.charset.UnmappableCharacterException: Input length = 1","user":{"login":"RadoBuransky","id":3110877,"avatar_url":"https://avatars.githubusercontent.com/u/3110877?v=3","gravatar_id":"","url":"https://api.github.com/users/RadoBuransky","html_url":"https://github.com/RadoBuransky","followers_url":"https://api.github.com/users/RadoBuransky/followers","following_url":"https://api.github.com/users/RadoBuransky/following{/other_user}","gists_url":"https://api.github.com/users/RadoBuransky/gists{/gist_id}","starred_url":"https://api.github.com/users/RadoBuransky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RadoBuransky/subscriptions","organizations_url":"https://api.github.com/users/RadoBuransky/orgs","repos_url":"https://api.github.com/users/RadoBuransky/repos","events_url":"https://api.github.com/users/RadoBuransky/events{/privacy}","received_events_url":"https://api.github.com/users/RadoBuransky/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2015-09-24T11:32:52Z","updated_at":"2015-12-15T09:50:03Z","closed_at":null,"body":"I have some nice Slovak characters in source code. For example:\r\n\r\n```scala\r\nclass Class2 {\r\n  def msg_test = println(\"test code ŠTEFÁNIK\")\r\n}\r\n```\r\n\r\nBut then if I run Scoverage it crashes with following:\r\n\r\n```\r\nInput length = 1\r\njava.nio.charset.UnmappableCharacterException: Input length = 1\r\n\tat java.nio.charset.CoderResult.throwException(CoderResult.java:282)\r\n\tat sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:339)\r\n\tat sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)\r\n\tat java.io.InputStreamReader.read(InputStreamReader.java:184)\r\n\tat java.io.BufferedReader.read1(BufferedReader.java:210)\r\n\tat java.io.BufferedReader.read(BufferedReader.java:286)\r\n\tat java.io.Reader.read(Reader.java:140)\r\n\tat scala.io.BufferedSource.mkString(BufferedSource.scala:96)\r\n\tat scoverage.report.CodeGrid.source(CodeGrid.scala:63)\r\n\tat scoverage.report.CodeGrid.<init>(CodeGrid.scala:17)\r\n\tat scoverage.report.ScoverageHtmlWriter.filePage(ScoverageHtmlWriter.scala:78)\r\n```\r\n\r\nIt is obviously related to encoding. I am able to reproduce it by explicitly setting wrong encoding in `CodeGrid.scala` line 63:\r\n\r\n```scala\r\n  private def source(mfile: MeasuredFile): String = Source.fromFile(mfile.source, \"windows-1252\").mkString\r\n```\r\n\r\nCurrent implementation uses an arbitrary default encoding which is probably not ideal. It can be different for every one of us. I would propose to hardcode UTF-8. If you like this idea, I will send a pull request soon."},"comment":{"url":"https://api.github.com/repos/scoverage/scalac-scoverage-plugin/issues/comments/164705931","html_url":"https://github.com/scoverage/scalac-scoverage-plugin/issues/134#issuecomment-164705931","issue_url":"https://api.github.com/repos/scoverage/scalac-scoverage-plugin/issues/134","id":164705931,"user":{"login":"gslowikowski","id":219863,"avatar_url":"https://avatars.githubusercontent.com/u/219863?v=3","gravatar_id":"","url":"https://api.github.com/users/gslowikowski","html_url":"https://github.com/gslowikowski","followers_url":"https://api.github.com/users/gslowikowski/followers","following_url":"https://api.github.com/users/gslowikowski/following{/other_user}","gists_url":"https://api.github.com/users/gslowikowski/gists{/gist_id}","starred_url":"https://api.github.com/users/gslowikowski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gslowikowski/subscriptions","organizations_url":"https://api.github.com/users/gslowikowski/orgs","repos_url":"https://api.github.com/users/gslowikowski/repos","events_url":"https://api.github.com/users/gslowikowski/events{/privacy}","received_events_url":"https://api.github.com/users/gslowikowski/received_events","type":"User","site_admin":false},"created_at":"2015-12-15T09:50:03Z","updated_at":"2015-12-15T09:50:03Z","body":"Nobody's interested in this functionality anymore?"}}