Re: [MacRuby-devel] A ruby string with ASCII-8BIT encoding is really an NSData and not an NSString

2010-05-28 Thread Carl Lerche
uld only work for Ruby strings and raise an exception > for NSStrings. > > Laurent > > On May 28, 2010, at 1:41 PM, Carl Lerche wrote: > >> Laurent, >> >> There is no NS* encoding that will correctly return the data from the >> ASCII-8BIT encoded string witho

Re: [MacRuby-devel] A ruby string with ASCII-8BIT encoding is really an NSData and not an NSString

2010-05-28 Thread Carl Lerche
ence method on String to return NSDatas, but > Strings already respond to dataUsingEncoding: , so I'm not sure if another > method is needed. On the other side, NSData objects respond to #to_str which > returns a Ruby string (with BINARY encoding). > > Laurent > > On May

[MacRuby-devel] A ruby string with ASCII-8BIT encoding is really an NSData and not an NSString

2010-05-28 Thread Carl Lerche
Hello, I've been playing around with macruby a bunch and I hit a point of confusion. I basically did "".pack("H*") which returns a ruby string. This string is an ASCII-8BIT encoded ruby string which is an alias for a Binary string (aka, it has no encoding). IMO, this should really be backed by