B4J Question File.ReadMap encoding question

bigluo

Member
actually, i am study Erel's jRDC2 example, when my database name contains Chinese, the server cannot open the db, i changed the db name to English, it's OK.
i logged the db name:
B4X:
JdbcURL: jdbc:jtds:sqlserver://localhost/2éêˉ3?V2012
but then real settings are:
B4X:
JdbcUrl=jdbc:jtds:sqlserver://localhost/采石场V2012

the code used to read settings are:
B4X:
Private Sub LoadConfigMap As Map
    Return File.ReadMap(File.DirAssets, "config.properties")
End Sub

how can i get correct encoding strings?
Thanks!
 
Solution
File.ReadMap is based on Java properties files which are unfortunately expected to be encoded with ISO-8859-1. Either change the file encoding (Notepad++) or parse the text file yourself.

bigluo

Member
thanks, and i find there are a ini file read/write library, which can resolve the problem:
thank you.
 
Upvote 0
Top