[MacRuby-devel] Iconv and MacRoman

Yvon Thoraval yvon.thoraval at gmail.com
Wed Apr 14 07:49:21 PDT 2010


Hey all,

I've downloaded and installed the latest and get an error when attempting to
convert from UTF-8 to MacRoman, here is the error message :

/Library/Frameworks/MacRuby.framework/Versions/0.6/usr/lib/ruby/1.9.0/iconv.rb:40:in
`ns_encoding:': unrecognized encoding `' (RuntimeError)
    from
/Library/Frameworks/MacRuby.framework/Versions/0.6/usr/lib/ruby/1.9.0/iconv.rb:17:in
`initialize:'
    from /Users/yt/dev/Signature/./change_signature_macruby.rb:199:in
`block'
    from /Users/yt/dev/Signature/./change_signature_macruby.rb:192:in
`change_signature:'
    from /Users/yt/dev/Signature/./change_signature_macruby.rb:65:in
`parse_option:'
    from /Users/yt/dev/Signature/./change_signature_macruby.rb:4:in `<main>'

the faulty script being :

      utf8_2_macroman = Iconv.new('MacRoman', 'UTF-8')
      la[i] = utf8_2_macroman.iconv(signature.split(/#{LF}/).join(CR))

it seems MacRuby isn't using the same iconv as ruby 1.9 because a similar
sript, running well with Ruby 1.9, uses :
      la[i] = Iconv.conv('MacRoman', 'UTF-8',
signature.split(/#{LF}/).join(CR))

however, with that line i get :
/Users/yt/dev/Signature/./change_signature_macruby.rb:199:in `block':
undefined method `conv' for Iconv:Class (NoMethodError)


best,

Yvon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-devel/attachments/20100414/055f511f/attachment.html>


More information about the MacRuby-devel mailing list