marcick Well-Known Member Licensed User Longtime User Jul 21, 2023 #1 I'm using this code to read a textfile containg lines like this B4X: First Par=this is the first par In B4i no problems, but in B4A I obtain "First" as key and "Par=this is the first par" as value I can find workarounds by myself modifying the text file (removing spaces at beginning like "FirstPar=" or "First_Par=") but I would avoid it if possible.. The second difference is that in B4i I can read the file (UTF-8 encoded) and show correctly the accented letters, whil ein B4A I had to convert the file with ANSI encoding.
I'm using this code to read a textfile containg lines like this B4X: First Par=this is the first par In B4i no problems, but in B4A I obtain "First" as key and "Par=this is the first par" as value I can find workarounds by myself modifying the text file (removing spaces at beginning like "FirstPar=" or "First_Par=") but I would avoid it if possible.. The second difference is that in B4i I can read the file (UTF-8 encoded) and show correctly the accented letters, whil ein B4A I had to convert the file with ANSI encoding.
Erel B4X founder Staff member Licensed User Longtime User Jul 21, 2023 #2 B4i uses a simple parser for the map file. It looks for the first equal sign and splits the line. B4A / B4J File.ReadMap is (unfortunately) based on Java properties implementation. You will need to escape the space and replace it with \u0020. Better to use keys without spaces. Upvote 0
B4i uses a simple parser for the map file. It looks for the first equal sign and splits the line. B4A / B4J File.ReadMap is (unfortunately) based on Java properties implementation. You will need to escape the space and replace it with \u0020. Better to use keys without spaces.
marcick Well-Known Member Licensed User Longtime User Jul 21, 2023 #3 I need spaces in the keys because they becomes titles in MsgBox. So do you mean like this ? B4X: First\u0020Par=this is the first par and it will works in B4i also ? Upvote 0
I need spaces in the keys because they becomes titles in MsgBox. So do you mean like this ? B4X: First\u0020Par=this is the first par and it will works in B4i also ?
Erel B4X founder Staff member Licensed User Longtime User Jul 21, 2023 #4 No. Better to put underscore and show it with: Code: Dim s As String = key.Replace("_", " ") Or something similar. Upvote 0
No. Better to put underscore and show it with: Code: Dim s As String = key.Replace("_", " ") Or something similar.