i m trying to read a file having having arabic text and then i need to place read text in a text view..
following is the code i tried:
public static String readRawFile(Context ctx, int resId) throws UnsupportedEncodingException {
InputStream inputStream = ctx.getResources().openRawResource(resId);
InputStreamReader isr = new InputStreamReader(inputStream, "UTF-8");
BufferedReader reader = new BufferedReader(isr);
String line;
StringBuilder text = new StringBuilder();
try {
while ((line = reader.readLine()) != null) {
text.append(line);
Log.e("Line Read", line);
text.append('\n');
}
} catch (IOException e) {
return null;
}
return text.toString();
}
but what i the file read is following
��(P3�EP ��qDDGP ��qD1QN-�EN@pFP ��qD1QN-PJEP ���
how should i read file such that the text read is in arabic