开发者

reading unicode text from assets

开发者 https://www.devze.com 2023-01-15 10:52 出处:网络
Trying to read an utf-8 encoded file in android... InputStreamReader reader = new InputStreamReader(assets.open(\"data.txt\"), \"UTF-8\");

Trying to read an utf-8 encoded file in android...

InputStreamReader reader = new InputStreamReader(assets.open("data.txt"), "UTF-8");
BufferedReader br = new BufferedReader(reader); 
String line;
//The line below throws an IOException!!
line = br.readLine();
开发者_StackOverflow中文版

What's wrong with this code?


It looks like you file is too big, you have to split it onto several files (1048576 bytes maximum for each) or find another way to reduce file size. Here is an article about similar problem http://androidgps.blogspot.com/2008/10/dealing-with-large-resources.html

0

精彩评论

暂无评论...
验证码 换一张
取 消