I create scaffold and trying to save text with cirllic symbols i recieved: Encoding::UndefinedConversionError: U+043F from UTF-8 to US-ASCII: my database charset is utf8 in database.yml encoding:utf8 why rails is still trying to convert text to ascii? what should i do to save my data in utf8? -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Sep 4, 7:53 pm, Ilya Boltnev <roadtounive...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I create scaffold and trying to save text with cirllic symbols > i recieved: > Encoding::UndefinedConversionError: U+043F from UTF-8 to US-ASCII: > my database charset is utf8 > in database.yml encoding:utf8 > why rails is still trying to convert text to ascii? > what should i do to save my data in utf8?What is it that raises this error ? If for example you were writing data to a file you would need to make sure that the file was opened with the correct encoding set. Another problem that can occur is if you have a utf8 string that has come from your database but you then perform some operation with a string literal. Unless your files have a magic encoding comment at the top, that string literal will default to ASCII. Fred -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org 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.
Hi, El 04/09/2011 20:53, Ilya Boltnev escribió:> I create scaffold and trying to save text with cirllic symbols > i recieved: > Encoding::UndefinedConversionError: U+043F from UTF-8 to US-ASCII: > my database charset is utf8 > in database.yml encoding:utf8 > why rails is still trying to convert text to ascii? > what should i do to save my data in utf8? >Difficult to know where exactly is the problem, I work with latin symbols and after many encodings problems, I always convert the files to utf-8 (without bom) and add the magic comment "# encoding: UTF-8" to all the ".rb" and ".erb" files. -- Miquel Cubel -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org 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.