Skip to content
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

Rewrites are UTF-8 #15622

Merged
merged 2 commits into from
Sep 5, 2022
Merged

Rewrites are UTF-8 #15622

merged 2 commits into from
Sep 5, 2022

Conversation

som-snytt
Copy link
Contributor

Don't use platform default, as UTF-8 is specified everywhere. getBytes is the dangerous API.

Instead of getting the byte array, just write through the underlying encoder (which buffers). The stream writer closes the encoder which closes the underlying stream, as I verified not for the first time in my life.

@som-snytt som-snytt marked this pull request as ready for review July 9, 2022 04:52
@som-snytt
Copy link
Contributor Author

@dwijnand Not sure if anyone cares about how rewrites are written, and also not sure how this crossed my radar except while trying out rewrites, so I'm notifying you as the most finicky member of the Scala 3 team. It seems obvious to me.

Copy link
Member

@dwijnand dwijnand left a comment

Choose a reason for hiding this comment

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

❤️

@dwijnand dwijnand merged commit 417f720 into scala:main Sep 5, 2022
@som-snytt som-snytt deleted the tweak/write-back branch February 6, 2023 04:11
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.

2 participants