From 15704080e0ba416d153058012c2f9d66f5d9d0cd Mon Sep 17 00:00:00 2001 From: 502647092 Date: Sun, 18 Sep 2016 21:47:03 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E8=AF=BB=E5=8F=96=E6=9C=AA=E6=8C=87=E5=AE=9A=E7=BC=96=E7=A0=81?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 502647092 --- src/main/java/pw/yumc/YumCore/paste/StickyNotes.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/pw/yumc/YumCore/paste/StickyNotes.java b/src/main/java/pw/yumc/YumCore/paste/StickyNotes.java index 5f980ff..222d1ce 100644 --- a/src/main/java/pw/yumc/YumCore/paste/StickyNotes.java +++ b/src/main/java/pw/yumc/YumCore/paste/StickyNotes.java @@ -7,6 +7,7 @@ import java.io.InputStreamReader; import java.io.OutputStream; import java.net.HttpURLConnection; import java.net.URL; +import java.nio.charset.Charset; import java.nio.file.Files; import java.util.ArrayList; import java.util.List; @@ -30,7 +31,8 @@ public class StickyNotes { final Paste paste = new Paste(); paste.addLine("异常提交测试!"); 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) { throw new IllegalArgumentException("文件不得为Null!"); } - addLines(Files.readAllLines(file.toPath())); + addLines(Files.readAllLines(file.toPath(), Charset.forName("UTF-8"))); } public void addLine(final String str) {