Beja Expert Licensed User Longtime User Feb 20, 2015 #1 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: Feb 20, 2015
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.
KMatle Expert Licensed User Longtime User Feb 20, 2015 #2 I've found this: http://stackoverflow.com/questions/7962704/how-to-support-arabic-text-in-android/7962813#7962813 It *seems* that you have to install a special font and convert the chars (a bit). Upvote 0
I've found this: http://stackoverflow.com/questions/7962704/how-to-support-arabic-text-in-android/7962813#7962813 It *seems* that you have to install a special font and convert the chars (a bit).
Erel B4X founder Staff member Licensed User Longtime User Feb 20, 2015 #3 Just use File.WriteString and load it with File.ReadString. It will use UTF8 and it supports all characters. Upvote 0
Just use File.WriteString and load it with File.ReadString. It will use UTF8 and it supports all characters.
Beja Expert Licensed User Longtime User Feb 20, 2015 #4 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). Code: 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
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). Code: 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
Erel B4X founder Staff member Licensed User Longtime User Feb 22, 2015 #5 It can't be Beja. The problem is somewhere else. Beja said: I can see it directly from the device storage Click to expand... Use a text editor such as Notepad++ to check it. You are probably opening it with an editor that doesn't support UTF8. Upvote 0
It can't be Beja. The problem is somewhere else. Beja said: I can see it directly from the device storage Click to expand... Use a text editor such as Notepad++ to check it. You are probably opening it with an editor that doesn't support UTF8.
Beja Expert Licensed User Longtime User Feb 22, 2015 #6 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 Feb 22, 2015 #7 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
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.
Erel B4X founder Staff member Licensed User Longtime User Feb 22, 2015 #8 If you are unable to solve it then upload a small example that demonstrates the issue. Upvote 0
Beja Expert Licensed User Longtime User Feb 22, 2015 #9 here it is! Attachments smallAppExample.zip smallAppExample.zip 12.2 KB · Views: 378 Upvote 0
klaus Expert Licensed User Longtime User Feb 22, 2015 #10 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. Upvote 0
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.