1

中国の Web サイトは常に gbk 文字セットを使用します。サイトからデータを取得しようとしています:

var url = "http://nga.178.com/thread.php?fid=7";
var client = Ti.Network.createHTTPClient({
    // function called when the response data is available
    onload : function(e) {
        Ti.API.info("Received text: " + this.responseText);
        alert('success');
    },
    // function called when an error occurs, including a timeout
    onerror : function(e) {
        Ti.API.debug(e.error);
        alert(e.error + client.status);


        Ti.API.debug(client.responseText);
    },
    timeout : 50000 // in milliseconds
});
// Prepare the connection.
client.open("GET",url);
// Send the request.

client.send();

しかし、それは応答します:

[DEBUG] :  <title>ÌáʾÐÅÏ¢</title>
4

0 に答える 0