#737: Unpack inconsistencies (possibly related to issue #605?) ---------------------------------+------------------------------------------ Reporter: babs.d...@… | Owner: lsansone...@… Type: defect | Status: new Priority: major | Milestone: Component: MacRuby | Keywords: Grit, unpack ---------------------------------+------------------------------------------
Comment(by babs.d...@…): Replying to [comment:2 macr...@…]: > This might be down to the encodings, what encoding do you get the constant and packed string? The packed string I believe will be using the BINARY or ASCII-8BIT encoding, in order to compare the two strings you might need to use :force_encoding on the constant, provided its a Ruby string and not an NSString. Yep. The Constant was encoded as UTF-8 and the packed string was ASCII- 8BIT. This alleviated the problem: {{{ PACK_IDX_SIGNATURE.force_encoding(Encoding::ASCII_8BIT) }}} From what I've read, the encoding in Ruby 1.9 was the culprit here. Is this a common issue? :force_encoding seems a bit hackish, is there a "best practice" way to ensure consistent encoding in Ruby? -- Ticket URL: <http://www.macruby.org/trac/ticket/737#comment:3> MacRuby <http://macruby.org/> _______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel