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

Beja

Expert
Licensed 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
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
 

Beja

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

Beja

Expert
Licensed 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.
 

klaus

Expert
Licensed User
I tested your code with french text with éè and it works.
Be sure you do a long click to save the file.
As you have an empty Click event routine, a click on the save button does nothing.
 
Top