kgiszczak / shale

Shale is a Ruby object mapper and serializer for JSON, YAML, TOML, CSV and XML. It allows you to parse JSON, YAML, TOML, CSV and XML data and convert it into Ruby data structures, as well as serialize data structures into JSON, YAML, TOML, CSV or XML.
https://shalerb.org/
MIT License
626 stars 19 forks source link

Encoding and declaration #12

Closed martinnicolas closed 1 year ago

martinnicolas commented 1 year ago

Sometimes we need to add the encoding to declaration. like this:

  <?xml version="1.0" encoding="UTF-8"?>

It could be a nice improvement!.

kgiszczak commented 1 year ago

Thanks, fixed, now you can also specify version:

obj.to_xml(declaration: '1.1', encoding: 'ASCII') # encoding: true defaults to 'UTF-8'
martinnicolas commented 1 year ago

Thanks!. Great job!.