manoelcampos / xml2lua

XML Parser written entirely in Lua that works for Lua 5.1+. Convert XML to and from Lua Tables 🌖💱
MIT License
287 stars 73 forks source link

how to process international codepages / unicode ? #32

Closed Micke3rd closed 4 years ago

Micke3rd commented 4 years ago

Hi Manoel, I'm executing the embedded example "example4-table2xml.lua" in europe, where because of the different codepage, the row {_attr={type="legal"}, name="University of Brasília", city="Brasília-DF"} is wrong transformed to `

Brasília-DF
<name>University of Brasília</name>

` The example file is utf encrypted, though the source shouldn't be the reason. Any suggestions how I can solve it ?

thnx Micke

to deliver more examples local people = { person = { {_attr={type="natural"}, name="Micke", city="Aßlar"}, {_attr={type="natural"}, name="Micke", city="MÜnchen"}, {_attr={type="natural"}, name="Micke", city="AltÖtting"}, {_attr={type="legal"}, name="University of Brasília", city="Brasília-DF"} } } is wrong transformed to `

Aßlar Micke MÜnchen Micke AltÖtting Micke Brasília-DF University of Brasília

`

manoelcampos commented 4 years ago

Hello @Micke3rd

It's very strange. UTF8 is exactly to avoid such issues. I checked that all files on the project are encoded with that charset. Which operating system and Lua version are you using?