关于Android使用HttpURLConnection传输中文乱码问题

2024-12-04 06:07:15
推荐回答(1个)
回答1:

conn = (HttpURLConnection) mUrl.openConnection();
        conn.setRequestMethod("GET");
        conn.setDoOutput(true);
        conn.setDoInput(true);
        conn.setUseCaches(false);
        conn.setRequestProperty("Content-type","application/x-www-form-urlencoded;charset=UTF-8"); 
        conn.connect();

试试