Any suggestion/idea would be appreciated
Uri
Uri
--
You received this message because you are subscribed to the Google Groups "Israel.rb - the Israel Ruby & Rails Developers group" group.
To post to this group, send email to isra...@googlegroups.com.
To unsubscribe from this group, send email to israelrb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/israelrb?hl=en.
It does not work for me, i.e. the string "=?windows-1255?B?MDkuZG9j?
=" does not convert.
There seems to be a missing step, some kind of preparation action on
the string that would allow us to perform the iconv
Uri
On Dec 17, 7:16 pm, Adam Fine <a...@adamfine.net> wrote:
> On Thu, Dec 17, 2009 at 8:28 AM, ulewin <ule...@gmail.com> wrote:
> > Need to convert windows-1255 encoded strings (e.g. =?windows-1255?B?
> > MDkuZG9j?=" ) to UTF-8
>
> > Any suggestion/idea would be appreciated
>
> require 'iconv'
> Iconv.conv('utf-8', 'windows-1255', windows_1255_str)
>
> -Adam
>
> > Uri
>
> > --
>
> > You received this message because you are subscribed to the Google Groups
> > "Israel.rb - the Israel Ruby & Rails Developers group" group.
> > To post to this group, send email to isra...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > israelrb+u...@googlegroups.com<israelrb%2Bunsu...@googlegroups.com>
require 'iconv'
require "base64"
base_string = "=?windows-1255?B?MDkuZG9j?="
base_string.gsub!('=?windows-1255?B?','').gsub!('?=','')
decoded_string = Base64.decode64(base_string)
output_string = Iconv.conv('utf-8', 'windows-1255',
decoded_string )