修复读取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{
|
}else{
|
||||||
append("没有找到穿山甲demo,请将穿山甲demo放置在 input"+File.separator+"csjDemo文件夹中");
|
append("没有找到穿山甲demo,请将穿山甲demo放置在 input"+File.separator+"csjDemo文件夹中");
|
||||||
csjDemo.mkdirs();
|
csjPath.mkdirs();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,14 +1,7 @@
|
|||||||
package com.qy.utils;
|
package com.qy.utils;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.*;
|
||||||
import java.io.File;
|
import java.nio.charset.StandardCharsets;
|
||||||
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.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
@ -130,9 +123,9 @@ public class Tools {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
String tmp, str = "";
|
||||||
try {
|
try {
|
||||||
reader = new BufferedReader(new FileReader(file));
|
reader = new BufferedReader( new InputStreamReader(new FileInputStream(file), StandardCharsets.UTF_8));
|
||||||
String tmp, str = "";
|
|
||||||
while ((tmp = reader.readLine()) != null) {
|
while ((tmp = reader.readLine()) != null) {
|
||||||
str += tmp;
|
str += tmp;
|
||||||
}
|
}
|
||||||
@ -140,6 +133,7 @@ public class Tools {
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// TODO Auto-generated catch block
|
// TODO Auto-generated catch block
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
System.out.println(str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return json;
|
return json;
|
||||||
|
Loading…
Reference in New Issue
Block a user