Skip to content

Commit aa834af

Browse files
committed
use the old charset.forName instead of standart to avoid JDK level set
1 parent 86553fb commit aa834af

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

binding/java/src/main/java/org/lionsoul/ip2region/SearchTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,9 @@ public static void benchTest(String[] args) throws IOException {
147147
Searcher searcher = createSearcher(dbPath, cachePolicy);
148148
long count = 0, costs = 0, tStart = System.nanoTime();
149149
String line;
150+
final Charset charset = Charset.forName("utf-8");
150151
final FileInputStream fis = new FileInputStream(srcPath);
151-
final BufferedReader reader = new BufferedReader(new InputStreamReader(fis, StandardCharsets.UTF_8));
152+
final BufferedReader reader = new BufferedReader(new InputStreamReader(fis, charset));
152153
while ((line = reader.readLine()) != null) {
153154
String l = line.trim();
154155
String[] ps = l.split("\\|", 3);

0 commit comments

Comments
 (0)