On Wednesday, 15 May 2013 07:30:14 UTC-4, UA wrote:
>
> I have a Rails app. One of my clients is importing French Text which 
> is appearing weirdly. Check below example: 
>
>     1. str = "--- \nFrench: \"3. Combien de r\\xC3\\xA9gions y a-t-il 
> au Cameroon?\"\nEnglish: 3. How many regions are there in Cameroon?\n" 
>
> Can someone assist please? 
>
>
Where is this text coming from? Because that string looks like YAML, 
complete with the opening "---". \xC3\xA9 is the UTF-8 encoding of 
codepoint U+00E9, "small letter e with acute", something you'd expect in 
French text.

If you do `YAML.load(str)` in 1.9 or higher, this is what appears:

irb: YAML.load(str)
===> {"French"=>"3. Combien de régions y a-t-il  au Cameroon?", 
"English"=>"3. How many regions are there in Cameroon?"}

--Matt Jones

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/76daf6fd-a064-4317-8052-157b13925562%40googlegroups.com?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to