-
Notifications
You must be signed in to change notification settings - Fork 149
Open
Labels
bugSomething isn't workingSomething isn't workingscalac compatibilityIssues tied with compatibility with the scalac (compiler) command.Issues tied with compatibility with the scalac (compiler) command.
Description
Version(s)
0.1.14
Describe the bug
When running a script with non-UTF-8 encoding, even when the -encoding
compiler param is passed, it is not respected.
To Reproduce
▶ cat script.sc
println("€")
▶ iconv -f UTF-8 -t CP1252 script.sc > script-CP-1252.sc
▶ cat script-CP-1252.sc
println("�")
▶ scala-cli script.sc
Compiling project (Scala 3.2.0, JVM)
Compiled project (Scala 3.2.0, JVM)
€
▶ scala-cli script-CP-1252.sc
Compiling project (Scala 3.2.0, JVM)
Compiled project (Scala 3.2.0, JVM)
�
▶ scala-cli script-CP-1252.sc -O -encoding -O cp1252
Compiling project (Scala 3.2.0, JVM)
Compiled project (Scala 3.2.0, JVM)
�
Expected behaviour
▶ scala-cli script-CP-1252.sc -O -encoding -O cp1252
Compiling project (Scala 3.2.0, JVM)
Compiled project (Scala 3.2.0, JVM)
€
Additional context
Discovered when spiking for #1310.
This bug only happens with .sc
scripts. .scala
files are being handled correctly.
▶ cat Main.scala
object Main extends App {
println("€")
}
▶ iconv -f UTF-8 -t CP1252 Main.scala > Main-CP-1252.scala
▶ scala-cli Main.scala
Compiling project (Scala 3.2.0, JVM)
Compiled project (Scala 3.2.0, JVM)
€
▶ scala-cli Main-CP-1252.scala -O -encoding -O cp1252
Compiling project (Scala 3.2.0, JVM)
Compiled project (Scala 3.2.0, JVM)
€
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingscalac compatibilityIssues tied with compatibility with the scalac (compiler) command.Issues tied with compatibility with the scalac (compiler) command.