I was trying to send an http request in my controller to get the content of the response and display it in a text field in the view, but sometimes i got a "redundant UTF-8 sequence" exception. Even if the exception was not raised, the chinese characters cannot be properly displayed.What should I do? --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Mon, Mar 17, 2008 at 3:35 PM, phoenix <zht.phoenix-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I was trying to send an http request in my controller to get the > content of the response and display it in a text field in the view, > but sometimes i got a "redundant UTF-8 sequence" exception. Even if > the exception was not raised, the chinese characters cannot be > properly displayed.What should I do?post your controller code... Mikel http://lindsaar.net/ --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
my action code: def get_content @url = params[:url] response = Net::HTTP.get_response(URI.parse(@url)) @content = response.body end On 3月17日, 下午2时32分, "Mikel Lindsaar" <raasd...@gmail.com> wrote:> On Mon, Mar 17, 2008 at 3:35 PM, phoenix <zht.phoe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > I was trying to send an http request in my controller to get the > > content of the response and display it in a text field in the view, > > but sometimes i got a "redundant UTF-8 sequence" exception. Even if > > the exception was not raised, the chinese characters cannot be > > properly displayed.What should I do? > > post your controller code... > > Mikelhttp://lindsaar.net/--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---