V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
jmania
V2EX  ›  Android

android 中用 AsyncHttpClient 获取 html 页面出错

  •  
  •   jmania · 2015-05-06 18:14:17 +08:00 · 4601 次点击
    这是一个创建于 3278 天前的主题,其中的信息可能已经有所发展或是发生改变。
    同样的代码获取 utf-8 的就没问题
    但是网页是 gbk 的就出错.
    什么问题啊?
    2 条回复    2015-05-07 09:49:32 +08:00
    jinyang656
        1
    jinyang656  
       2015-05-06 19:07:11 +08:00 via Android
    都知道编码问题了 那你就指定编码撒
    jmania
        2
    jmania  
    OP
       2015-05-07 09:49:32 +08:00
    @jinyang656 但是在 get 的时候就报错
    05-07 01:48:02.575 27513-27513/? V/AsyncHttpResponseHandler﹕ Progress 186 from 186 (100%)
    05-07 01:48:02.579 27513-27513/? W/System.err﹕ org.apache.http.client.HttpResponseException: Internal Server Error
    05-07 01:48:02.579 27513-27513/? W/System.err﹕ at com.loopj.android.http.AsyncHttpResponseHandler.sendResponseMessage(AsyncHttpResponseHandler.java:404)
    05-07 01:48:02.579 27513-27513/? W/System.err﹕ at com.loopj.android.http.AsyncHttpRequest.makeRequest(AsyncHttpRequest.java:161)
    05-07 01:48:02.579 27513-27513/? W/System.err﹕ at com.loopj.android.http.AsyncHttpRequest.makeRequestWithRetries(AsyncHttpRequest.java:178)
    05-07 01:48:02.579 27513-27513/? W/System.err﹕ at com.loopj.android.http.AsyncHttpRequest.run(AsyncHttpRequest.java:109)
    05-07 01:48:02.579 27513-27513/? W/System.err﹕ at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
    05-07 01:48:02.579 27513-27513/? W/System.err﹕ at java.util.concurrent.FutureTask.run(FutureTask.java:237)
    05-07 01:48:02.579 27513-27513/? W/System.err﹕ at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
    05-07 01:48:02.579 27513-27513/? W/System.err﹕ at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
    05-07 01:48:02.579 27513-27513/? W/System.err﹕ at java.lang.Thread.run(Thread.java:841)
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3517 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 10:34 · PVG 18:34 · LAX 03:34 · JFK 06:34
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.