mirror of
https://e.coding.net/circlecloud/YumCore.git
synced 2024-11-22 01:48:50 +00:00
fix: 修复文件读取未指定编码的问题
Signed-off-by: 502647092 <admin@yumc.pw>
This commit is contained in:
parent
d9c3faf077
commit
15704080e0
@ -7,6 +7,7 @@ import java.io.InputStreamReader;
|
|||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.net.HttpURLConnection;
|
import java.net.HttpURLConnection;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
import java.nio.charset.Charset;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -30,7 +31,8 @@ public class StickyNotes {
|
|||||||
final Paste paste = new Paste();
|
final Paste paste = new Paste();
|
||||||
paste.addLine("异常提交测试!");
|
paste.addLine("异常提交测试!");
|
||||||
paste.addThrowable(new Throwable());
|
paste.addThrowable(new Throwable());
|
||||||
System.out.println(p.post(StickyNotes.Expire.HalfHour, paste));;
|
System.out.println(p.post(StickyNotes.Expire.HalfHour, paste));
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -189,7 +191,7 @@ public class StickyNotes {
|
|||||||
if (file == null) {
|
if (file == null) {
|
||||||
throw new IllegalArgumentException("文件不得为Null!");
|
throw new IllegalArgumentException("文件不得为Null!");
|
||||||
}
|
}
|
||||||
addLines(Files.readAllLines(file.toPath()));
|
addLines(Files.readAllLines(file.toPath(), Charset.forName("UTF-8")));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addLine(final String str) {
|
public void addLine(final String str) {
|
||||||
|
Loading…
Reference in New Issue
Block a user