I use to get data AQuery, source encoding windows-1251 at the first show everything is fine, but after the data is retrieved from the cache, do not I get the correct encoding.
I do
String url = "http://example.com/";
long expire = 15 * 60 * 1000;
aq.ajax(url, String.class, expire, new AjaxCallback<String>() {
@Override
public void callback(String url, String html, AjaxStatus status) {
Log.i("DATA",html);
}
});
the manual says so
If custom encoding is needed, uses the encoding() method to fix the encoding.
Tried so too, but it did not work
byte[] b = html.getBytes(Charset.forName("cp1251"));
try {
html = new String(b, "UTF-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
Maybe somebody faced with this problem prompt decision means AQuery or how encoding string to UTF-8 > CP1251