※ 引述《hnint0926 (泰山)》之銘言:
: ※ 引述《RichieRich (Richie)》之銘言:
: : try{
: : File f = new File("c:\\a.txt");
: : FileInputStream fi = new FileInputStream(f);
: : InputStreamReader isr = new InputStreamReader(fi,"UTF-8");
: : BufferedReader br = new BufferedReader(isr);
: : String line = "";
: : while( (line=br.readLine())!=null){
: : System.out.println(line);
: : }
: : }
: : catch(EOFException e){
: : System.out.println("End of stream");
: : }
: : 以上是我寫程式碼 可是text file 上有簡體讀出來卻有問號繁體是沒問題
: : 請問如何改進?
: 印象中簡體中文好像不是UTF8八!應該是編碼抓錯,你在確定看看
: ,印象中好像是33..什麼的一堆數字。
UTF-8 是 Unicode 的一種編碼而已.
Unicode 則是有包括繁簡體甚至大量其他語言
Alien
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 202.22.246.26