修复读取json会出现乱码的问题
This commit is contained in:
parent
c58b890c61
commit
520ea8cff4
3
src/META-INF/MANIFEST.MF
Normal file
3
src/META-INF/MANIFEST.MF
Normal file
@ -0,0 +1,3 @@
|
||||
Manifest-Version: 1.0
|
||||
Main-Class: com.qy.ui.AppMain
|
||||
|
@ -64,7 +64,7 @@ public class ChuanShanJiaUi {
|
||||
}
|
||||
}else{
|
||||
append("没有找到穿山甲demo,请将穿山甲demo放置在 input"+File.separator+"csjDemo文件夹中");
|
||||
csjDemo.mkdirs();
|
||||
csjPath.mkdirs();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,14 +1,7 @@
|
||||
package com.qy.utils;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.*;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Random;
|
||||
|
||||
import org.json.JSONObject;
|
||||
@ -130,9 +123,9 @@ public class Tools {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
reader = new BufferedReader(new FileReader(file));
|
||||
String tmp, str = "";
|
||||
try {
|
||||
reader = new BufferedReader( new InputStreamReader(new FileInputStream(file), StandardCharsets.UTF_8));
|
||||
while ((tmp = reader.readLine()) != null) {
|
||||
str += tmp;
|
||||
}
|
||||
@ -140,6 +133,7 @@ public class Tools {
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
System.out.println(str);
|
||||
}
|
||||
}
|
||||
return json;
|
||||
|
Loading…
Reference in New Issue
Block a user