From: Craig Files Date: 2001-07-11T07:15:06+09:00 Subject: [ruby-talk:17634] SWIG and strings Hi, Has anybody been able to typemap strings in swig with ruby? Given the .i file for swig: %module example class Test { public: string str; Test() { str = "putz"; } }; In Ruby: require 'example' c = Example::Test.new() c.str .... returns the following, not "putz" # In Perl we can add to the .i file the following %typemap(ruby,out) string { $target = sv_newmortal(); sv_setpv($target,((char *)$source->c_str())); argvi++; } Any ideas for writing the typemap for strings in ruby or is there any reference material for swig and ruby on typemaps? Craig Files