[.Net] File.ReadAllText - UTF8Encoding

LucaMs

Expert
Licensed User
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?)
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.
 

LucaMs

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

UTF8 supports all characters.
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 :D.

Or I will make some attempt in the Chinese Forum :D


[Speedy (DonManfred) how are your umlaut? :)]
 

LucaMs

Expert
Licensed User
There is no simple way to detect the encoding. The same binary data can be decoded correctly in many encodings.
So, it is an hard question.

I would like to ask how this is done with html:

如果你还没有安装Basic4android和Java SDK,请先参照后面的链接里面的安装和配置方法:
http://www.basic4ppc.com/forum/basic...droid-sdk.html

在这个教程里面,我们将建立一个新的AVD (Android Virtual Device)并生成模拟器实例. 然后我们将建立一个简单的程序,这个程序将显示一个简单的信息框,并写一个信息到日志里.
你也可以通过IDE 连接到一个真正的设备上:
使用ADB连接你的设备
使用B4A-Bridge连接你的设备
常见的问题解决列在在本教程的后面. 如果你碰见的问题没在列表或者无法解决的话, 请与 support@basic4ppc.com 联系


but I do not.

1) because it may be different;
2) because you ask me to open a new thread :D:D:D
 
Top