Forum: Ruby on Rails Displaying encoded strings?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
8c49880a7f274947b01d576c5828a5f6?d=identicon&s=25 lon (Guest)
on 2005-11-30 04:01
(Received via mailing list)
Is there a way to present the following string correctly in a browser?

  =?UTF-8?B?RndkOiDoqo3lrprjga7mioDooZPnmoTln7rmupY=?=

We have a raw e-mail stored and some metadata. ActionMailer correctly
displays the message contents using UTF8 encoding in MySQL and the
layout views.

But this message field needs to be decoded in some manner I think.

Due to the database structure (not under my control), we have to use
the metadata subject field when displaying large lists. The raw e-
mail message is only parsed by ActionMailer when viewing the entire
message for obvious reasons.

Any suggestions would be greatly appreciated.

--
Lon Baker
E88842bdfe00001492b724febb865865?d=identicon&s=25 jonte (Guest)
on 2005-11-30 09:00
(Received via mailing list)
Lon Baker wrote:
> Due to the database structure (not under my control), we have to use
>
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
try this...
[code]
  require 'iconv'
  newstring =
Iconv.new('utf-8','iso-8859-1',).iconv(some_variable_with_utf8_encoded_string_goes_here)

[/code]

Change 'iso-8859-1' to prefered charset...

// Jonas Montonen, http://bytadvd.se
This topic is locked and can not be replied to.