I did a lot of trials but cannot read hebrew letters from raw resource text file. Every time I try I get squars with ?. If I m reading English letters everything is OK. I tried also using UTF-8 and I got gibirish too.
Here is the code that I m using.
InputStream inStream = getResources().openRawResource(R.raw.questutf8);
if (inStream != null)
{
InputStreamReader inputReader = new InputStreamReader(inStream);
int c, i=0;
int i=0;
char [] cb = new char[1];
byte [] buf = new byte[100];
String line;
while (inputReader.read(cb, 0, 1) > -1)
{
if(cb[0] ==
|| cb[0] ==
)
{
line = new String(buf, 0, i, "UTF-8");
i=0;
//Doing somthing with line
}
else
{
buf[i++] = (byte) cb[0];
}
}
}
Does anyone have any idea what should I do? Thanks in advance !