指定读取行政区划文件编码

pull/1712/head^2
648540858 2024-12-09 14:27:54 +08:00
parent 5bbd461d88
commit c0ef6a4524
1 changed files with 2 additions and 1 deletions

View File

@ -15,6 +15,7 @@ import java.io.BufferedReader;
import java.io.File; import java.io.File;
import java.io.InputStream; import java.io.InputStream;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files; import java.nio.file.Files;
/** /**
@ -54,7 +55,7 @@ public class CivilCodeFileConf implements CommandLineRunner {
inputStream = Files.newInputStream(civilCodeFile.toPath()); inputStream = Files.newInputStream(civilCodeFile.toPath());
} }
BufferedReader inputStreamReader = new BufferedReader(new InputStreamReader(inputStream)); BufferedReader inputStreamReader = new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8));
int index = -1; int index = -1;
String line; String line;
while ((line = inputStreamReader.readLine()) != null) { while ((line = inputStreamReader.readLine()) != null) {