Forum: Ruby on Rails Builder templates served as US-ASCII

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
71b46c4f6e9cfec742e18deeec6d2cd9?d=identicon&s=25 Joost Baaij (joost)
on 2005-12-01 22:58
When I produce an xml output with builder, my webserver's headers say
it's encoded as US-ASCII. Since I have iso-8859-1 characters in there, I
would like to change it. I use lighttpd as a web server, but I don't
think it matters since the Builder templates are produced by rails.

Can anyone help?
Has anyone ever produced an actual _valid_ rss feed using Builder?
http://feedvalidator.org/check.cgi?url=http%3A%2F%...
821395fe70906c8290df7f18ac4ac6cf?d=identicon&s=25 technoweenie (Guest)
on 2005-12-01 23:32
(Received via mailing list)
On 12/1/05, joost baaij <joost@spacebabies.nl> wrote:
> When I produce an xml output with builder, my webserver's headers say
> it's encoded as US-ASCII. Since I have iso-8859-1 characters in there, I
> would like to change it. I use lighttpd as a web server, but I don't
> think it matters since the Builder templates are produced by rails.
>
> Can anyone help?
> Has anyone ever produced an actual _valid_ rss feed using Builder?
> http://feedvalidator.org/check.cgi?url=http%3A%2F%...
>

Yup...

http://feedvalidator.org/check.cgi?url=http%3A%2F%...

Doh, this is embarassing, but it's not an encoding error :)

Try this in your controller somewhere:

  headers['Content-Type'] = 'text/xml; charset=iso-8859-1'

--
rick
http://techno-weenie.net
71b46c4f6e9cfec742e18deeec6d2cd9?d=identicon&s=25 Joost Baaij (joost)
on 2005-12-02 10:36
>
> Try this in your controller somewhere:
>
>   headers['Content-Type'] = 'text/xml; charset=iso-8859-1'
>

Brilliant, thanks!
This topic is locked and can not be replied to.