# XML encoding

**URL:** <https://www.ruby-forum.com/t/xml-encoding/183509>\
**Category:** Rails\
**Created:** [February 15, 2010, 10:21pm UTC](https://www.ruby-forum.com/t/xml-encoding/183509 "2010-02-15T22:21:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![maiken](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/7bcc69/32.png) [@maiken](https://www.ruby-forum.com/u/maiken)\
**Post date:** [February 15, 2010, 10:21pm UTC](https://www.ruby-forum.com/t/xml-encoding/183509/1 "2010-02-15T22:21:58Z")

</div>

Hello,

I generate a .xml using the function to\_xml

```
      format.xml { render :xml => @pisos.to_xml(:methods =>

```

[:provincia\_nombre, :ayuntamiento\_nombre]) }

And the xml is encoded with UTF-8, I would like to know how to encode  
the xml with ISO 8859-1 or another one.

Thank you
