一、讀取Unicode文件
/** * 讀取Unicode編碼文本文件 * @param resource String - 文件名 * @return String - Unicode
) { System.out.println(ex); } finally { is = null; } return strReturn;}二、讀取UTF-8文件
/** * 讀取UTF-8編碼文本文件 * @param resource String - 文件名 * @return String - UTF-8文本 */public static String read_UTF(String resource) { byte Word_utf[] = new byte[1024]; String strReturn = null; InputStream is; try { is = instance.getClass().getResourceAsStream(resource); is.read(Word_utf); is.close(); strReturn = new String(Word_utf, "UTF-8"); } catch (IOException ex) { System.out.println(ex); } return strReturn;}