Forum: Ruby on Rails Using globalize and Net::HTTP.get

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
29e31baf2b88476c3a297db0b5afd08d?d=identicon&s=25 bathow (Guest)
on 2006-04-01 05:49
Today we did some cool stuff with globalize (the library) and
Net::HTTP.get. I thought it was pretty awesome, but most people I talked
to really didn't think so, so I've come here to share my excitement on
this list w/ ppl who'd understand :P

Anyways, we took globalize and extended it so that websites were
translated on the fly by Google Translate / Babelfish type services out
there when someone switched the locale to something Google could
translate, and there was no entry in the db. (Maybe it should be an add
on to globalize)

The translation was horrible, but it was a fun hack.

One problem I didn't get over forever which no one seemed to be able to
help me with is that the content from Net::HTTP.get is not in UTF-8
form. To convert this, you must use .toutf8 on the string object. It was
simple, but I spent almost a whole day on this, so I document it here
for posterity, in case anyon else ever runs into it.

Here are the details. I figured you guys would be interested in it.
This topic is locked and can not be replied to.