Skip to content

Fix reading of jar resource files for dottydoc #2546

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 26, 2017

Conversation

felixmulder
Copy link
Contributor

This was the bug that didn't work with the released version. Since the codec was not specified, it assumed ISO-8859-1 :(

Now it is correctly UTF8 (master race)

@felixmulder felixmulder requested a review from liufengyun May 26, 2017 14:55
@felixmulder felixmulder merged commit 11476d1 into scala:master May 26, 2017
@felixmulder felixmulder deleted the fix/dottydoc-input-format branch May 26, 2017 15:13
@@ -9,8 +9,8 @@ trait ResourceFinder {
final case class ResourceNotFoundException(message: String) extends Exception(message)

protected def getResource(r: String): String =
Option(getClass.getResourceAsStream(r)).map(scala.io.Source.fromInputStream)
Option(getClass.getResourceAsStream(r))
.map(scala.io.Source.fromInputStream(_)(scala.io.Codec.UTF8))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't hardcode it. Use Properties.sourceEncoding that all the other compiler parts use.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it needs to be hardcoded here. This is just reading of assets from the jar, it has nothing to do with compiling sources. This is guaranteed to always be UTF8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants