Hello. I''m reading a csv file into my application, and when I enconter a special character like ç, I have a problem, since my database is in utf-8. Is there a way to convert a string to utf-8? -- 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-/JYPxA39Uh5TLH3MbocFFw@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 -~----------~----~----~----~------~----~------~--~---
Pedro Cardoso wrote:> Hello. > > I''m reading a csv file into my application, and when I enconter a > special character like ç, I have a problem, since my database is in > utf-8. Is there a way to convert a string to utf-8?OK. Found it myself :P For someone loking for the same thing ... http://www.ruby-doc.org/stdlib/libdoc/iconv/rdoc/index.html -- 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-/JYPxA39Uh5TLH3MbocFFw@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 -~----------~----~----~----~------~----~------~--~---
On Feb 19, 2007, at 7:10 PM, Pedro Cardoso wrote:> I''m reading a csv file into my application, and when I enconter a > special character like ç, I have a problem, since my database is in > utf-8. Is there a way to convert a string to utf-8?Yes, use iconv. You''ll need to know the input character encoding, or give http://raa.ruby-lang.org/project/charguess/ a try otherwise. -- fxn --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@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 -~----------~----~----~----~------~----~------~--~---