Ruby on Rails Friday, May 28, 2010

Jaap Haagmans wrote:
> Let me put in another way: we have multiple people updating the
> language strings in the YAML files. For people working on OS X, the
> characters will show up as squares on Linux and vice versa. I only
> control one of these systems. How would you approach this?

Put the UTF-8 characters in the files. Make sure everyone's editor is
set to UTF-8.

> Our
> approach has worked for some time now this way

It's the wrong approach. You should apply any necessary escaping on
output. As you've discovered, pre-escaped data is unusable if you're
generating multiple formats.

> and we only have
> problems with ActionMailer subjects.

No, you'll have problems with anything that isn't HTML. So...do it
right. Store the actual characters. Let the renderer escape characters
on output. This is the correct and flexible approach.


Best,
--
Marnen Laibow-Koser
http://www.marnen.org
marnen@marnen.org

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment