Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Fix UTF-8 output for Builder

#1446

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"

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

State: resolved
Milestone: none
Assigned to: DHH DHH
Importance: High

Activity

  1. Jeremy Kemper
    Jeremy Kemper

    This'll probably be incompatible with fast_xs

    December 9th, 2008 @ 12:23 AM

  2. DHH
    DHH
    • 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.

    January 8th, 2009 @ 09:22 PM

  3. Jim Van Fleet
    Jim Van Fleet
    • 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.

    January 16th, 2009 @ 08:01 PM

  4. Jim Van Fleet
    Jim Van Fleet

    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.

    January 20th, 2009 @ 04:01 PM

  5. Dennis Theisen
    Dennis Theisen
    • 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"

    November 29th, 2010 @ 10:41 PM