DarkWolfalpha Member Apr 11, 2020 #1 B4X: Sub Activity_Create(FirstTime As Boolean) Activity.LoadLayout("Layout1") Label1.Text = File.ReadString(File.DirAssets,"N.txt") Label1.Text.GetBytes("UTF8") End Sub My text is in Persian but it doesn't work properly. What should I do? Last edited: Apr 25, 2020
B4X: Sub Activity_Create(FirstTime As Boolean) Activity.LoadLayout("Layout1") Label1.Text = File.ReadString(File.DirAssets,"N.txt") Label1.Text.GetBytes("UTF8") End Sub My text is in Persian but it doesn't work properly. What should I do?
Erel B4X founder Staff member Licensed User Longtime User Apr 12, 2020 #2 Code is wrong. This line doesn't do anything: Label1.Text.GetBytes("UTF8") There are two options: 1. The file is not encoded in UTF8. 2. The default font doesn't support the Persian letters. I guess that the encoding is wrong. Upvote 0
Code is wrong. This line doesn't do anything: Label1.Text.GetBytes("UTF8") There are two options: 1. The file is not encoded in UTF8. 2. The default font doesn't support the Persian letters. I guess that the encoding is wrong.
DarkWolfalpha Member Apr 14, 2020 #3 Erel said: Code is wrong. This line doesn't do anything: Label1.Text.GetBytes("UTF8") There are two options: 1. The file is not encoded in UTF8. 2. The default font doesn't support the Persian letters. I guess that the encoding is wrong. Click to expand... How I can Change encoding? Upvote 0
Erel said: Code is wrong. This line doesn't do anything: Label1.Text.GetBytes("UTF8") There are two options: 1. The file is not encoded in UTF8. 2. The default font doesn't support the Persian letters. I guess that the encoding is wrong. Click to expand... How I can Change encoding?
Erel B4X founder Staff member Licensed User Longtime User Apr 15, 2020 #4 You need to find the current encoding before you can do anything. Notepad++ can help you. The next step is to either change the file encoding with Notepad++ or use TextReader which allows setting the encoding. Upvote 0
You need to find the current encoding before you can do anything. Notepad++ can help you. The next step is to either change the file encoding with Notepad++ or use TextReader which allows setting the encoding.
DarkWolfalpha Member Apr 16, 2020 #5 Erel said: You need to find the current encoding before you can do anything. Notepad++ can help you. The next step is to either change the file encoding with Notepad++ or use TextReader which allows setting the encoding. Click to expand... Thanks, my problem is solved ? ? Upvote 0
Erel said: You need to find the current encoding before you can do anything. Notepad++ can help you. The next step is to either change the file encoding with Notepad++ or use TextReader which allows setting the encoding. Click to expand... Thanks, my problem is solved ? ?