Skip to content

Commit b5e2279

Browse files
committed
Write-back is UTF-8
1 parent 22080c5 commit b5e2279

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

compiler/src/dotty/tools/dotc/rewrites/Rewrites.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import collection.mutable
88
import scala.annotation.tailrec
99
import dotty.tools.dotc.reporting.Reporter
1010

11+
import java.nio.charset.StandardCharsets.UTF_8
12+
1113
/** Handles rewriting of Scala2 files to Dotty */
1214
object Rewrites {
1315
private class PatchedFiles extends mutable.HashMap[SourceFile, Patches]
@@ -56,7 +58,7 @@ object Rewrites {
5658

5759
def writeBack(): Unit = {
5860
val chars = apply(source.underlying.content)
59-
val bytes = new String(chars).getBytes
61+
val bytes = new String(chars).getBytes(UTF_8)
6062
val out = source.file.output
6163
out.write(bytes)
6264
out.close()

0 commit comments

Comments
 (0)