B4J Question Unexpected Result from File.ReadString and File.ReadBytes on UTF-8 Text File

B4XDev

Active Member
Licensed User
I have a text file (UTF-8) being used as a preferences file. When I read from it, I get some strange marks where blank lines are.

The prefs.ini file


Reading it with ReadMap fails, of course. But reading it with ReadString and ReadBytes provides unexpected results:

Using File.ReadBytes


Using File.ReadString


What are the lines that begin with the tilde (~)?! How do I get a clean input of my text file?
 

B4XDev

Active Member
Licensed User
I iterated through a File.ReadList() version, and those lines come up as .length = 0... So, everything seems to be as you say. ?

Thank you!
 
Upvote 0