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.

Make utf8 partial rendering from within a content_for work in ruby1.9

#1988

rendering utf8 content from a partial being rendered in a content_for(:foo) block fails on Ruby 1.9, because of encoding mismatch (ASCII_8BIT vs UTF_8).

Reported by Johan Sørensen · February 16th, 2009 @ 01:12 PM

State: stale
Milestone: 3.x
Assigned to: Jeremy Kemper Jeremy Kemper
Importance: none

Activity

  1. Johan Sørensen
  2. Michael Koziarski
    Michael Koziarski
    • Assigned user set to Jeremy Kemper

    Assigning to jeremy as he's the 1.9 compat guy.

    Are there going to be other instances where we need to do this 'force to utf8' stuff? Perhaps we should define a no-op method we can call in 1.8 with a 1.9 method which does the force? Alternatively use foo.mb_chars internally?

    March 9th, 2009 @ 05:57 AM

  3. Johan Sørensen
    Johan Sørensen

    I haven't found any other places it's needed, but granted I've only been running this particular app where I found that issue on 1.9 for a few weeks. Other things might appear in other apps.

    March 9th, 2009 @ 02:53 PM

  4. Johan Sørensen
  5. Johan Sørensen
    Johan Sørensen

    TextHelper #concat should always deal with utf8 content while we're at it

    April 28th, 2009 @ 12:26 PM

  6. Jeremy Kemper
    Jeremy Kemper

    What about non-utf8 encodings?

    April 28th, 2009 @ 04:44 PM

  7. Jeremy Kemper
    Jeremy Kemper
    • State changed from new to incomplete

    May 28th, 2009 @ 08:01 AM

  8. dennis_probst (at mac)
    dennis_probst (at mac)
    • Tag cleared.

    Hey guys,

    I have this UTF-8 issue and need to fix it, but I don't know how to use these .patch files. Can someone point me to where I can find information about using .patch files (on Mac).

    thanks in advance!

    November 30th, 2009 @ 08:20 PM

  9. dennis_probst (at mac)
    dennis_probst (at mac)

    nevermind I just updated from 2.3.4 to 2.3.5

    November 30th, 2009 @ 08:59 PM

  10. JasonKing
    JasonKing

    What's pending on this issue Jeremy?

    When you say "non-utf8" encodings - do you mean ASCII_8BIT and US_ASCII? Ie. does the patch not work with ASCII?

    Or do you mean other, less common, encodings?

    March 12th, 2010 @ 12:22 AM

  11. Jeremy Kemper
    Jeremy Kemper

    I mean any encoding that isn't utf8. Ruby supports many and this breaks all of them.

    March 12th, 2010 @ 02:03 AM

  12. Ilya
    Ilya

    The path is good only for template that include pure utf-8 text and thus fail to be rendered. If you have something like <%= text %> where variable "text" is utf-8 it will fail in "concat" anyway.
    I tried to patch ERB/Compiler/compile but didn't really succeeded at this.
    Maybe someone will come with a better solution.
    Of course TextHelper patch works for those who use <% concat text %>.

    April 28th, 2010 @ 10:17 AM

  13. Jeremy Kemper
    Jeremy Kemper
    • Milestone changed from 2.x to 3.x

    May 4th, 2010 @ 06:48 PM

  14. Santiago Pastorino
    Santiago Pastorino
    • State changed from incomplete to open
    • Importance changed from to

    This issue has been automatically marked as stale because it has not been commented on for at least three months.

    The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.

    Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.

    February 2nd, 2011 @ 04:41 PM

  15. Santiago Pastorino
    Santiago Pastorino
    • State changed from open to stale

    February 2nd, 2011 @ 04:41 PM

  16. bingbing