Skip to content

Commit 17e25ce

Browse files
committed
fix: can't set commandLine.charset to utf-8 when sys is gbk
#49
1 parent 3fc04b1 commit 17e25ce

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/io/plugin/tsnode/lib/cmd/NodeJSCommandLine.kt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,18 @@ object MyNodeCommandLineUtil
119119
*/
120120
}
121121

122+
/**
123+
* [gbk system issues #49](https://github.com/bluelovers/idea-run-typescript/issues/49?notification_referrer_id=NT_kwDOAAKQHrIxMTk1MTQ2MjQ2MzoxNjc5NjY#issuecomment-2291094308)
124+
*/
122125
fun configureCharset(commandLine: GeneralCommandLine)
123126
{
124-
val charset = commandLine.charset.toString()
125-
if (charset == "x-windows-950" || charset == "x-windows-936")
127+
var charset = commandLine.charset.toString().lowercase()
128+
129+
LOG.info("current commandLine.charset ${charset}")
130+
131+
charset = charset.lowercase()
132+
133+
if (true || charset == "x-windows-950" || charset == "x-windows-936" || charset == "gbk")
126134
{
127135
commandLine.withCharset(Charset.forName("UTF-8"))
128136
}

0 commit comments

Comments
 (0)