提交 2789fd0d authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Do not use CP1252

上级 77d5024d
...@@ -166,7 +166,7 @@ public class Profiler implements Runnable { ...@@ -166,7 +166,7 @@ public class Profiler implements Runnable {
} }
continue; continue;
} }
try (Reader reader = new InputStreamReader(new FileInputStream(arg), "CP1252")) { try (Reader reader = new InputStreamReader(new FileInputStream(arg))) {
LineNumberReader r = new LineNumberReader(reader); LineNumberReader r = new LineNumberReader(reader);
while (true) { while (true) {
String line = r.readLine(); String line = r.readLine();
...@@ -177,7 +177,7 @@ public class Profiler implements Runnable { ...@@ -177,7 +177,7 @@ public class Profiler implements Runnable {
} }
} }
} }
try (Reader reader = new InputStreamReader(new FileInputStream(arg), "CP1252")) { try (Reader reader = new InputStreamReader(new FileInputStream(arg))) {
LineNumberReader r = new LineNumberReader(reader); LineNumberReader r = new LineNumberReader(reader);
processList(readStackTrace(r)); processList(readStackTrace(r));
} }
......
...@@ -8,6 +8,7 @@ package org.h2.test.scripts; ...@@ -8,6 +8,7 @@ package org.h2.test.scripts;
import java.io.InputStream; import java.io.InputStream;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.io.LineNumberReader; import java.io.LineNumberReader;
import java.nio.charset.StandardCharsets;
import java.sql.Connection; import java.sql.Connection;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
...@@ -46,8 +47,7 @@ public class TestScriptSimple extends TestDb { ...@@ -46,8 +47,7 @@ public class TestScriptSimple extends TestDb {
reconnect(); reconnect();
String inFile = "org/h2/test/scripts/testSimple.in.txt"; String inFile = "org/h2/test/scripts/testSimple.in.txt";
InputStream is = getClass().getClassLoader().getResourceAsStream(inFile); InputStream is = getClass().getClassLoader().getResourceAsStream(inFile);
LineNumberReader lineReader = new LineNumberReader( LineNumberReader lineReader = new LineNumberReader(new InputStreamReader(is, StandardCharsets.UTF_8));
new InputStreamReader(is, "Cp1252"));
try (ScriptReader reader = new ScriptReader(lineReader)) { try (ScriptReader reader = new ScriptReader(lineReader)) {
while (true) { while (true) {
String sql = reader.readStatement(); String sql = reader.readStatement();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论