Android and windows-1251 ?

A lot of russian sites are based on windows-1251, but sqlite uses UTF-8 and UTF-16. So, if you won’t prepare your data for android – all cyrillic symbols will be broken.

How to deal with it?
For the most part of java programmers who familiar with – this issue is well known.
We just need to specify encoding type of our data to

public static String inputStreamToString(final InputStream stream) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(stream, "windows-1251"));
StringBuilder sb = new StringBuilder();
        String line;
        while ((line = br.readLine()) != null) {
        return sb.toString();
Add Comment Register

Leave a Reply

3 + seven =