Android Question [Solved] How to save EditText as Unicode?

Beja

Expert
Licensed User
Longtime User
Arabic text can be displayed correctly on EditText1, but when save it and later load it, it is loaded in Chinese (real Chinese) leters.
How can one saves it in Unicode?

Thanks in advance.
 
Last edited:

Beja

Expert
Licensed User
Longtime User
Hi Erel,
Following is the code.. it's saving, but loadfile is not loading the file 1.txt back to EditText1.text, but
I can see it directly from the device storage (English correctly but Arabic in Chinese chars).

B4X:
Sub loadfile
	EditText1.Text = File.ReadString(File.DirRootExternal, "1.txt") 
End Sub
Sub btnSave_Click
	File.WriteString(File.DirRootExternal, "1.txt", EditText1.Text)
End Sub
 
Upvote 0

Beja

Expert
Licensed User
Longtime User
Thanks and I am using Notpad that comes with Windows 8.1
will try Notepad ++, I hope it's free ;)
 
Upvote 0

Beja

Expert
Licensed User
Longtime User
You are right Erel,
I saved it to my PC and opened it from there in MS Word.. it showed the correct original Arabic text.
Thanks for the hint.
What's left now it is not loading back to edittext1 as in the above code.
 
Upvote 0

Beja

Expert
Licensed User
Longtime User
here it is!
 

Attachments

  • smallAppExample.zip
    12.2 KB · Views: 235
Upvote 0
Top