Skip to content

Commit c52971f

Browse files
author
angelozerr
committed
Use UTF-8 with tsserver.
1 parent ed31f67 commit c52971f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

core/ts.core/src/ts/nodejs/NodejsProcess.java

+5-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515

1616
public class NodejsProcess extends AbstractNodejsProcess {
1717

18+
// tsserver works with UTF_8 enconding.
19+
private static final String UTF_8 = "UTF-8";
20+
1821
private final File tsFile;
1922

2023
/**
@@ -71,7 +74,7 @@ public void run() {
7174
try {
7275
try {
7376
notifyStartProcess(0);
74-
BufferedReader r = new BufferedReader(new InputStreamReader(process.getInputStream()));
77+
BufferedReader r = new BufferedReader(new InputStreamReader(process.getInputStream(), UTF_8));
7578
String line = null;
7679
while ((line = r.readLine()) != null && process != null) {
7780
notifyMessage(line);
@@ -121,7 +124,7 @@ public void start() {
121124
builder.directory(getProjectDir());
122125

123126
this.process = builder.start();
124-
this.out = new PrintStream(process.getOutputStream());
127+
this.out = new PrintStream(process.getOutputStream(), false, UTF_8);
125128

126129
errThread = new Thread(new StdErr());
127130
errThread.setDaemon(true);

0 commit comments

Comments
 (0)