diff --git a/changelog.d/204.fixed.md b/changelog.d/204.fixed.md new file mode 100644 index 00000000..c544c0a6 --- /dev/null +++ b/changelog.d/204.fixed.md @@ -0,0 +1 @@ +Change default configuration to explicitly avoid setting BOM, fixing potential issue on some systems \ No newline at end of file diff --git a/modules/core/src/main/kotlin/com/metalbear/mirrord/MirrordConfigAPI.kt b/modules/core/src/main/kotlin/com/metalbear/mirrord/MirrordConfigAPI.kt index 2de67d9f..d5e9f186 100644 --- a/modules/core/src/main/kotlin/com/metalbear/mirrord/MirrordConfigAPI.kt +++ b/modules/core/src/main/kotlin/com/metalbear/mirrord/MirrordConfigAPI.kt @@ -4,6 +4,7 @@ import com.google.gson.Gson import com.intellij.notification.NotificationType import com.intellij.openapi.project.Project import com.intellij.openapi.vfs.VirtualFile +import java.nio.charset.Charset /** * For detecting mirrord config specified in run configuration. @@ -20,8 +21,7 @@ private const val DEFAULT_CONFIG = "fs": "read", "env": true } -} -""" +}""" class InvalidConfigException(path: String, reason: String) : MirrordError("failed to process config $path - $reason") @@ -134,6 +134,8 @@ class MirrordConfigAPI(private val service: MirrordProjectService) { val mirrordDir = getMirrordDir() ?: getMirrordDirParent().createChildDirectory(this, ".mirrord") return mirrordDir.createChildData(this, "mirrord.json") + .apply { bom = null } + .apply { charset = Charset.forName("UTF-8") } .apply { setBinaryContent(DEFAULT_CONFIG.toByteArray()) } } }