LucaMs Expert Licensed User Longtime User Nov 15, 2014 #1 Is it enough use UTF8Encoding.Default to read a text file (.txt) as in the title? Will make it possible to read special characters such as accents Germans, for example, or Cyrillic, etc.?
Is it enough use UTF8Encoding.Default to read a text file (.txt) as in the title? Will make it possible to read special characters such as accents Germans, for example, or Cyrillic, etc.?
LucaMs Expert Licensed User Longtime User Nov 15, 2014 #2 no, it is not enough! For Cyrillic, for example, I have to use: IO.File.ReadAllText(FullFileName, System.Text.Encoding.GetEncoding(1251)) (Why "Strike-Through" is not next to Bold-Italic-Underline?) 1251 is a "Code page" Last edited: Nov 15, 2014
no, it is not enough! For Cyrillic, for example, I have to use: IO.File.ReadAllText(FullFileName, System.Text.Encoding.GetEncoding(1251)) (Why "Strike-Through" is not next to Bold-Italic-Underline?) 1251 is a "Code page"
LucaMs Expert Licensed User Longtime User Nov 15, 2014 #3 I need to use that statement (...GetEncoding(1251) but because my Default is not for Cyrillic chars! Maybe on a russian PC, UTF8Encoding.Default works. So, I still need an answer
I need to use that statement (...GetEncoding(1251) but because my Default is not for Cyrillic chars! Maybe on a russian PC, UTF8Encoding.Default works. So, I still need an answer
Erel B4X founder Staff member Licensed User Longtime User Nov 15, 2014 #4 Is this question related to B4A?
LucaMs Expert Licensed User Longtime User Nov 15, 2014 #5 Erel said: Is this question related to B4A? Click to expand... No, even if I need it for B4A. But I do not think I should write it in Chit Chat!
Erel said: Is this question related to B4A? Click to expand... No, even if I need it for B4A. But I do not think I should write it in Chit Chat!
Erel B4X founder Staff member Licensed User Longtime User Nov 16, 2014 #6 LucaMs said: No, even if I need it for B4A. But I do not think I should write it in Chit Chat! Click to expand... It should be in the chit chat forum as it is not a B4A question (should we accept PHP, C, Assembler and other languages in the B4A forum?)
LucaMs said: No, even if I need it for B4A. But I do not think I should write it in Chit Chat! Click to expand... It should be in the chit chat forum as it is not a B4A question (should we accept PHP, C, Assembler and other languages in the B4A forum?)
LucaMs Expert Licensed User Longtime User Nov 16, 2014 #7 Erel said: It should be in the chit chat forum as it is not a B4A question (should we accept PHP, C, Assembler and other languages in the B4A forum?) Click to expand... You could search on Google: "site:basic4ppc.com PHP Questions". You're right but, as you can see, posting in b4a questions I have received no responses and in Chit Chat it would be read much less. The name, "Chit Chat", suggests "forum of things not related to programming". Additionally, this problem also exists reading a file using other languages (b4a, b4j and b4i). However, it does not matter, since the only answers were these yours.
Erel said: It should be in the chit chat forum as it is not a B4A question (should we accept PHP, C, Assembler and other languages in the B4A forum?) Click to expand... You could search on Google: "site:basic4ppc.com PHP Questions". You're right but, as you can see, posting in b4a questions I have received no responses and in Chit Chat it would be read much less. The name, "Chit Chat", suggests "forum of things not related to programming". Additionally, this problem also exists reading a file using other languages (b4a, b4j and b4i). However, it does not matter, since the only answers were these yours.
Erel B4X founder Staff member Licensed User Longtime User Nov 16, 2014 #8 The answer to your question is that it depends. You should use the same encoding as the encoding that was used when the file was saved. UTF8 supports all characters.
The answer to your question is that it depends. You should use the same encoding as the encoding that was used when the file was saved. UTF8 supports all characters.
LucaMs Expert Licensed User Longtime User Nov 16, 2014 #9 Erel said: The answer to your question is that it depends. You should use the same encoding as the encoding that was used when the file was saved. Click to expand... I suppose that if a Russian citizen save a text file using NotePad this file will be encoded in a different way from that of the Italian and the encoding depends on the settings on your PC. Should I try to detect what is the file encoding? Erel said: UTF8 supports all characters. Click to expand... This seems sufficient but, if so, other types of coding should not be necessary. Thanks for the reply, Erel. Maybe I will wait for the user complaints . Or I will make some attempt in the Chinese Forum [Speedy (DonManfred) how are your umlaut? ]
Erel said: The answer to your question is that it depends. You should use the same encoding as the encoding that was used when the file was saved. Click to expand... I suppose that if a Russian citizen save a text file using NotePad this file will be encoded in a different way from that of the Italian and the encoding depends on the settings on your PC. Should I try to detect what is the file encoding? Erel said: UTF8 supports all characters. Click to expand... This seems sufficient but, if so, other types of coding should not be necessary. Thanks for the reply, Erel. Maybe I will wait for the user complaints . Or I will make some attempt in the Chinese Forum [Speedy (DonManfred) how are your umlaut? ]
Erel B4X founder Staff member Licensed User Longtime User Nov 16, 2014 #10 LucaMs said: Should I try to detect what is the file encoding? Click to expand... There is no simple way to detect the encoding. The same binary data can be decoded correctly in many encodings.
LucaMs said: Should I try to detect what is the file encoding? Click to expand... There is no simple way to detect the encoding. The same binary data can be decoded correctly in many encodings.
LucaMs Expert Licensed User Longtime User Nov 16, 2014 #11 Erel said: There is no simple way to detect the encoding. The same binary data can be decoded correctly in many encodings. Click to expand... So, it is an hard question. I would like to ask how this is done with html: 如果你还没有安装Basic4android和Java SDK,请先参照后面的链接里面的安装和配置方法: http://www.b4x.com/forum/basic...droid-sdk.html 在这个教程里面,我们将建立一个新的AVD (Android Virtual Device)并生成模拟器实例. 然后我们将建立一个简单的程序,这个程序将显示一个简单的信息框,并写一个信息到日志里. 你也可以通过IDE 连接到一个真正的设备上: 使用ADB连接你的设备 使用B4A-Bridge连接你的设备 常见的问题解决列在在本教程的后面. 如果你碰见的问题没在列表或者无法解决的话, 请与 [email protected] 联系 but I do not. 1) because it may be different; 2) because you ask me to open a new thread
Erel said: There is no simple way to detect the encoding. The same binary data can be decoded correctly in many encodings. Click to expand... So, it is an hard question. I would like to ask how this is done with html: 如果你还没有安装Basic4android和Java SDK,请先参照后面的链接里面的安装和配置方法: http://www.b4x.com/forum/basic...droid-sdk.html 在这个教程里面,我们将建立一个新的AVD (Android Virtual Device)并生成模拟器实例. 然后我们将建立一个简单的程序,这个程序将显示一个简单的信息框,并写一个信息到日志里. 你也可以通过IDE 连接到一个真正的设备上: 使用ADB连接你的设备 使用B4A-Bridge连接你的设备 常见的问题解决列在在本教程的后面. 如果你碰见的问题没在列表或者无法解决的话, 请与 [email protected] 联系 but I do not. 1) because it may be different; 2) because you ask me to open a new thread
LucaMs Expert Licensed User Longtime User Nov 16, 2014 #12 On the other hand, the codings allowed by NotePad are these: So it will be enough that I studies and applies these.
On the other hand, the codings allowed by NotePad are these: So it will be enough that I studies and applies these.
LucaMs Expert Licensed User Longtime User Nov 16, 2014 #13 Resolved: I used a chinese .bas file as a template for my sw, without making any changes to it, and I can perfectly... read Chinese texts . Thanks again, Erel
Resolved: I used a chinese .bas file as a template for my sw, without making any changes to it, and I can perfectly... read Chinese texts . Thanks again, Erel
LucaMs Expert Licensed User Longtime User Nov 28, 2014 #14 https://www.b4x.com/android/forum/t...nsertion-of-log-statements.47510/#post-294400 Any suggestion?
Erel B4X founder Staff member Licensed User Longtime User Nov 30, 2014 #15 B4A saves files encoded with UTF8. If you are using UTF8 then the file will be loaded correctly. Make sure to also save it with UTF8.
B4A saves files encoded with UTF8. If you are using UTF8 then the file will be loaded correctly. Make sure to also save it with UTF8.
LucaMs Expert Licensed User Longtime User Nov 30, 2014 #16 Erel said: B4A saves files encoded with UTF8. If you are using UTF8 then the file will be loaded correctly. Make sure to also save it with UTF8. Click to expand... I used ReadAllLines and ReadAllText (VB.Net) without passing the argument Encoding and, at least for the German character, now it works. Thanks, Erel
Erel said: B4A saves files encoded with UTF8. If you are using UTF8 then the file will be loaded correctly. Make sure to also save it with UTF8. Click to expand... I used ReadAllLines and ReadAllText (VB.Net) without passing the argument Encoding and, at least for the German character, now it works. Thanks, Erel