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
On May 28, 2010, at 10:03 AM, Carl Lerche wrote:
> Hello,
Hi!
> 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 strin
Hi Carl,
Why not using -[NSString dataUsingEncoding:]? It would be better perf wise than
constructing a bytes array like you do.
As Josh mentioned, the fact that the String class can hold arbitrary data (not
only characters) is a design issue of Ruby that we unfortunately need to follow
for co
Laurent,
There is no NS* encoding that will correctly return the data from the
ASCII-8BIT encoded string without mangling it (as far as I could
figure out at least, I spent a good deal of time trying to).
Basically, there was no way to get a data object using the NSString
data* methods. My general
I see... you're right. I guess adding a #to_data method makes sense then.
Could you file a ticket on trac?
I believe the method should 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* enc
#732: Ruby strings should have a to_data method
---+
Reporter: m...@… | Owner: lsansone...@…
Type: enhancement| Status: new
Priority: minor |
Alright,
Here is the ticket: https://www.macruby.org/trac/ticket/732
-carl
On Fri, May 28, 2010 at 1:59 PM, Laurent Sansonetti
wrote:
> I see... you're right. I guess adding a #to_data method makes sense then.
> Could you file a ticket on trac?
>
> I believe the method should only work for Ru