看板 java 關於我們 聯絡資訊
我想要寫一個可以讀網頁的程式 基本上讀出來就像檢視網頁原始碼那樣 但是我寫的程式 google可以讀的到 kimo卻讀不到 會出現亂碼的問題 我有看了一些資料 加上了Charset big5 但是仍然是讀不到 想請教一下版上大大我的程式是出了什麼問題 以下是我的程式碼 public void GetHTML(String Address, String OutputFile) throws IOException, Exception { URL test=new URL(Address); URLConnection URLConn = (HttpURLConnection)test.openConnection(); URLConn.setRequestProperty("User-agent","IE/6.0"); URLConn.setRequestProperty("Accept-Charset", "Big5,utf-8"); } 感謝~ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 125.233.154.35
PttTime:new InputStreamReader(URLConn.getInputStream(),"UTF-8" 06/22 22:47