简体   繁体   中英

UTF-8 not working with Cyrillic text from raw folder

I have a text file in the res/raw folder in cyrilic.

InputStream ints = getResources().openRawResource(R.raw.h9);
input = new BufferedReader(new InputStreamReader(getResources().openRawResource(R.raw.h1), "UTF8"));

while (( line = input.readLine())  )
{
...
}

yet when I try to read it line by line in "UTF8", it gives me strange characters.

any ideas what might be wrong?

Thanks!

您对文件的编码方式有误。

知道了,它是用CP-1251编码的!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM