From add75a40593dd3f4ee2bc9162d7d87b3e51cdeef Mon Sep 17 00:00:00 2001 From: Taskeren Date: Thu, 11 Jul 2019 02:40:25 +0800 Subject: [PATCH] =?UTF-8?q?[+]=20=E4=BF=AE=E5=A4=8D=E8=BD=AC=E7=A0=81?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/cn/glycol/t18n/I18n.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/cn/glycol/t18n/I18n.java b/src/main/java/cn/glycol/t18n/I18n.java index 07012cd..0d66a2d 100644 --- a/src/main/java/cn/glycol/t18n/I18n.java +++ b/src/main/java/cn/glycol/t18n/I18n.java @@ -1,7 +1,10 @@ package cn.glycol.t18n; +import java.nio.ByteBuffer; +import java.nio.CharBuffer; import java.nio.charset.Charset; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; @SuppressWarnings("unused") @@ -98,8 +101,10 @@ public class I18n { return hasKey(key); } + private static final Charset DEFAULT_CHARSET = Charset.forName("unicode"); + private static String reEncode(String bef, Charset charset) { - byte[] bytes = bef.getBytes(); + byte[] bytes = bef.getBytes(charset); return new String(bytes, charset); }