[android-developers] How to read non-english fonts and display in app ?

2010-11-25 Thread Jaz
I am trying to read a raw text file with a non-english font and
display the contents in a TextView. However, while reading I donot see
the actual characters on the app. It displays special characters ...

Code being used is below ..

// find the view
TextView tv = (TextView)findViewById(R.id.japji);

//reads the file as an InputStream
String selectedBaani = readBaani();
tv.setText(selectedBaani);

// Set the typeface using font used in raw file
Typeface tf= Typeface.createFromAsset(getAssets(), GURMUKHI_FONT);
tv.setTypeface(tf);


Thx
jaz


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] How to read non-english fonts and display in app ?

2010-11-25 Thread Frank Weiss
If I'm not mistaken, the Dalvik VM uses UCS-16 internally, just like the
Java VM.

The question is probably what encoding does the file use, UTF-8? Is the
InputStreamReader using the correct encoding?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en