Hello Everybody,
Is there anything like Unicode.deocode(str) (I found it somewhere when
I googled, but not working )??
I have installed unicode using gem install unicode, but couldn''t get
how to use it.
Please please help me out solving this problem.
Thanks,
Prasad
Prasad wrote:
> Hello All,
>
> I am writing a facebook application in ruby on rails, which requires
> google search in one page.
> I''ve implemented this using a simple RESTful interface as follows:
>
> url = URI.parse( "http://ajax.googleapis.com/ajax/services/search/
> local?v=1.0&q="+params[:keyword] )
> req = Net::HTTP::Get.new(url.path+"?"+url.query)
> res = Net::HTTP.start(url.host, url.port) {|http|
> http.request(req) }
>
> The response has a Content-Type of text/javascript; charset=utf-8. and
> in JSON format
>
> So, I''m decoding the response into a hash as
> hash = ActiveSupport::JSON.decode(res.body)
>
> But, the data still contains some special characters starting with \u
> (utf-8 characters)
>
> How to decode them into html text in ruby?
>
> Thanks in Advance,
> Prasad
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---