Projects

Ticket #66 (closed defect: fixed)

Opened 4 years ago

Last modified 18 months ago

Death by Iconv

Reported by: rowland@… Owned by: lsansonetti@…
Priority: blocker Milestone: MacRuby 0.7
Component: MacRuby Keywords:
Cc:

Description

The following script goes into a spin and must be killed (MacRuby 0.2):

Shiny:eideticpdf brent$ cat iconvtest.rb 
require 'iconv'
ic = Iconv.new('UCS-2BE', 'ASCII')
ic.close

Shiny:eideticpdf brent$ macruby iconvtest.rb 
dyld: lazy symbol binding failed: Symbol not found: _rb_enc_find_index
  Referenced from: /Library/Frameworks/MacRuby.framework/Versions/0.2/usr/lib/ruby/1.9.0/universal-darwin9.0/iconv.bundle
  Expected in: flat namespace

dyld: Symbol not found: _rb_enc_find_index
  Referenced from: /Library/Frameworks/MacRuby.framework/Versions/0.2/usr/lib/ruby/1.9.0/universal-darwin9.0/iconv.bundle
  Expected in: flat namespace

Killed

Change History

follow-up: ↓ 2   Changed 4 years ago by lsansonetti@…

  • milestone set to MacRuby 1.0

Due to the new important changes in String, it is not easy to port Iconv. Let's do this later. Anyway, most (if not all?) of the iconv functionality should exist in String itself now.

in reply to: ↑ 1   Changed 4 years ago by rowland@…

Okay. For now I'll try to implement a simple compatibility layer using the Cocoa API so I can test the remainder of my library. Sorry to be lazy, what's the recommended way to detect MacRuby to implement version-specific behavior?

  Changed 4 years ago by lsansonetti@…

Currently this isn't very easy, but it should be better once RUBY_ENGINE is introduced in all implementations. You can still try to compare one of the values in rbconfig.rb, in the meantime. Example:

$ macruby -r rbconfig -e "p RbConfig::CONFIG['RUBY_INSTALL_NAME'] == 'macruby'"
true

Curiously, why do you need Iconv? If it's to create or translate strings using a given encoding, you may want to use the String API instead, even in pure 1.9. Then, your code would only use Iconv for 1.8.

  Changed 3 years ago by anonymous

  • milestone MacRuby 1.0 deleted

Milestone MacRuby 1.0 deleted

  Changed 18 months ago by martinlagardette@…

  • milestone set to MacRuby 0.7

This is fixed with r4416 :

$> cat iconvtest.rb 
require 'iconv'
ic = Iconv.new('UCS-2BE', 'ASCII')
ic.close
$> macruby iconvtest.rb
$>

  Changed 18 months ago by martinlagardette@…

  • status changed from new to closed
  • resolution set to fixed

Oops forgot to close :-)

Note: See TracTickets for help on using tickets.