BufferedReader br = null; try { br = new BufferedReader(new InputStreamReader(new FileInputStream(file), "gbk")); String item = null; while ((item = br.readLine()) != null) { Log.i(TAG, "item = " + item); } } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } finally { try { br.close(); } catch (IOException e) { e.printStackTrace(); } }
像这样,在读取时,指定编码 读取,则读到的中文可以正常显示。。。。
读中文txt里显示乱码问题
最新推荐文章于 2022-08-18 11:35:14 发布