ReadList

magarcan

Active Member
Licensed User
Longtime User
I'm using this code for reading a file:
Code: Copy
Dim List1 As List
List1 = File.ReadList(File.DirDefaultExternal, "1.txt")
For i = 0 to List1.Size - 1
   Log(List1.Get(i))
Next

And this one, for writing:
Code: Copy
Dim List1 As List
List1 = File.ReadList(File.DirDefaultExternal, "1.txt")

I've a problem with codification because some Latin characters lite: á, é ,í... apears like this �, How can I solve this??

Thanks!!
 
The problem is most probably somewhere else. Both WriteList and ReadList use UTF8 encoding which supports all Unicode characters.
File I'm reading looks like this:
Code: Copy
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE data PUBLIC "-//ASO//VE 2011 01" "http://www.lavuelta.com/11/xml/VE2011-01.dtd">
<data type="standings" race="VE" year="2011" stage="0100">
<standings type="ITG" oficiosa="0">
<rank position="1" number="103"/>
</standings>
</data>

Could be here the problem?
 
Upvote 0
Where does your file come from ?
The problem is that your file is encoded with iso-8859-1 and not with URF-8 !
That means that your file was not saved in B4A but somewhere with Windows.

Best regards.
File is an .XML that is downloaded from Internet...
 
Upvote 0
File is an .XML that is downloaded from Internet...

Strange characters are due to different encoding. Now, probably there is something for this case, but if there isn't, you have to create a subroutine for converting from one encoding to the other.
 
Upvote 0
Back
Top