This project is archived and is in readonly mode.

#1446 ✓resolved
DHH

Fix UTF-8 output for Builder

Reported by DHH | November 23rd, 2008 @ 12:14 PM

The following should not have been escaped. According to Sam Ruby there's a patch for the latest Builder, but Jim Weirich haven't released a new version with it. As soon as that version is out we should upgrade the bundle.


>> Post.first.title
=> "Iñtërnâtiônàl"
>> b= Builder::XmlMarkup.new; b.instruct!(:xml, :encoding => "UTF-8"); b.title(Post.first.title)
=> "<?xml version=\"1.0\" encoding=\"UTF-8\"?><title>I&#241;t&#235;rn&#226;ti&#244;n&#224;l</title>"
>> $KCODE
=> "UTF8"

Comments and changes to this ticket

  • Jeremy Kemper

    Jeremy Kemper December 9th, 2008 @ 12:23 AM

    This'll probably be incompatible with fast_xs

  • DHH

    DHH January 8th, 2009 @ 09:22 PM

    • State changed from “new” to “resolved”

    And actually it's only a visual issue. UTF-8 doesn't care. Depends on Jim Weirich releasing a new builder anyway. Nothing really for us to do here.

  • Jim Van Fleet

    Jim Van Fleet January 16th, 2009 @ 08:01 PM

    • Tag set to builder, fastxs

    After verifying that a test containing DHH's sample above passes using the GitHub version of Builder (yay!), I can also verify that Jeremy is right that fast_xs will continue to escape those values (boo!).

    I thought this might be useful information for others that find there way here, at the very least. I plan on pitching in a little bit here, but we'll see if there are any tangible results.

  • Jim Van Fleet

    Jim Van Fleet January 20th, 2009 @ 04:01 PM

    If there are those that need it, I created a 2.2.1 version of builder available from GitHub here. You can replace the 2.1.2 builder library inside ActionSupport with it, and disable fast_xs if need be.

  • Dennis Theisen

    Dennis Theisen November 29th, 2010 @ 10:41 PM

    • Importance changed from “” to “High”

    For anyone else having trouble with this:

    Updating to Builder 3.0.0 seems to solve the issue and it finally works when you set KCODE = "UTF8"

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Pages