How to draw Arabic Text on Android after reading from a file? -


I have come to know that how well Arabic characters are attracted using string literals (connected Has been done and left to right):

  textView.setTypeFace (getAssets (), "Desevasis.TTF"); TextView.setText ("\ uFEB3 \ uFE92 \ uFE98 \ uFE94");  

But for some reason I can not get Arabic to properly formatted if I read anything from a file using Input Striume:

Arabictext Txt:

  سبتة  

and code:

  InputStream istream = as.open ("arabictext.txt") ; String string; BufferedInputStream bis = New BufferedInputStream (istream); Read / buffer buffer * until there is nothing else to read (-1). * / Bytereferring buff = new bytereferver (50); Int current = 0; While ((current = bis.read ())! = -1) {baf.append (byte) on); } / * Convert bits read in a string * / String = new string (baf.toByteArray (), 0, baf.length (), "UTF-8");  

and then display the string in a text view. The letters have been correctly ordered, but they are not properly connected to the end of the word / word associated with the word, nor are they in proper form. It does not make sense to me because I thought that every character of each letter is a different unicode code point.

2) By inserting the actual code values ​​into the file, the reason for displaying code point values ​​just to text disruption is a string.

Any help would be appreciated! I just started to create a custom scene to draw the text, but it became complicated, fast.

Same Alaikom, in fact, there is a difference between the text you use in the direct code:

  textView.setText ("\ uFEB3 \ uFE92 \ uFE98 \ uFE94");  

And the file you got is that I think:

  \ u0633 \ u0628 \ u062a \ u064a  

Then try to insert the Sehreator into the final format (after showing) in the file, then you will get the expected result.

BR.


Comments