Skip to content

Commit

Permalink
Fallback to UTF-8 in setup-ide (#2599)
Browse files Browse the repository at this point in the history
  • Loading branch information
JD557 authored Dec 4, 2023
1 parent 9385014 commit 9f95620
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import ch.epfl.scala.bsp4j.BspConnectionDetails
import com.github.plokhotnyuk.jsoniter_scala.core.*
import com.google.gson.GsonBuilder

import java.nio.charset.Charset
import java.nio.charset.{Charset, StandardCharsets}

import scala.build.EitherCps.{either, value}
import scala.build.*
Expand Down Expand Up @@ -160,11 +160,12 @@ object SetupIde extends ScalaCommand[SetupIdeOptions] {
List("scala", "java").asJava
)

val charset = options.charset
.map(_.trim)
.filter(_.nonEmpty)
.map(Charset.forName)
.getOrElse(Charset.defaultCharset()) // Should it be UTF-8?
val charset =
options.charset
.map(_.trim)
.filter(_.nonEmpty)
.map(Charset.forName)
.getOrElse(StandardCharsets.UTF_8)

val gson = new GsonBuilder().setPrettyPrinting().create()

Expand Down

0 comments on commit 9f95620

Please sign in to comment.