Re: [MacRuby-devel] converting UTF-8 to MacRoman still output UTF-8

2010-04-21 Thread Yvon Thoraval
I've found a workover : def to_macroman(str) data = CFStringCreateExternalRepresentation(nil, str, KCFStringEncodingMacRoman, 0) if data.nil? raise "can't retrieve data from `#{str}'" end dest = "".force_encoding("MacRoman") # # force dest to be of "MacRoman" # dest += CFStringCreate

[MacRuby-devel] converting UTF-8 to MacRoman still output UTF-8

2010-04-21 Thread Yvon Thoraval
if i make use of the (pseudo) Iconv : macroman = Iconv.new('macintosh', 'utf-8', str) i found MacRoman is internally 'macintosh' because : puts "CFStringConvertEncodingToIANACharSetName(KCFStringEncodingMacRoman) = #{CFStringConvertEncodingToIANACharSetName(KCFStringEncodingMacRoman)}" gave me :

[MacRuby-devel] Iconv and MacRoman

2010-04-14 Thread Yvon Thoraval
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 /

[MacRuby-devel] MacRuby 0.6 and iconv

2010-03-29 Thread Yvon Thoraval
Hey all, i think i've successfully install MacRuby from svn (revision 3886) : zsh-% which macruby /usr/local/bin/macruby zsh-% macruby -v MacRuby version 0.6 (ruby 1.9.0) [universal-darwin10.0, x86_64] however i got : [1]18359 abort ./change_signature_macruby.rb this is due to the li

Re: [MacRuby-devel] encoding mismatch ?

2010-03-11 Thread Yvon Thoraval
2010/3/11 Laurent Sansonetti > Hi Yvon, > > 1.9 encodings in trunk have very little support for now, but we > significantly improved them in a branch that might get merged into trunk in > a few days (maybe today). I will post an update here once it's done. > > Laurent > > fine thanks ! my script

[MacRuby-devel] encoding mismatch ?

2010-03-11 Thread Yvon Thoraval
I have to read an UTF-8 encoded file with accentuated chars. if i do : #! /usr/local/bin/macruby # encoding: utf-8 SIGNATURES_FILE = "/Users/yt/dev/Signature/signatures.txt" open(SIGNATURES_FILE) do |file| file.each do |line| puts line end end i get the correct characters on t