0
所以我试图读取包含捷克字符(ř,š,š,ň等)的页面的HTML源代码。该页的字符集是windows-1250
(Content-type = text/html; charset=windows-1250
)。Windows.Web.Http.HttpClient字符编码
var hc = new Windows.Web.Http.HttpClient();
var uri = new Windows.Foundation.Uri("http://rozvrhuni.hys.cz/150909.html");
hc.defaultRequestHeaders.acceptLanguage.parseAdd("cs");
hc.defaultRequestHeaders.acceptEncoding.parseAdd("windows-1250");
hc.getStringAsync(uri).done(
function complete(result) {
htmlText = result;
},
function error(result) {
(new Windows.UI.Popups.MessageDialog("Non-existent content", "Error")).showAsync().done();
return;
}
);
我的代码获取源代码,但继续错读一些字符(R = O,C = E等)
我该怎么做才能正确读取页面?