[macruby-changes] [3635] MacRuby/branches/icu/string.c
source_changes at macosforge.org
source_changes at macosforge.org
Fri Feb 26 15:44:04 PST 2010
Revision: 3635
http://trac.macosforge.org/projects/ruby/changeset/3635
Author: lsansonetti at apple.com
Date: 2010-02-26 15:44:04 -0800 (Fri, 26 Feb 2010)
Log Message:
-----------
make sure rb_enc_str_new() cannot be called with binary encoding
Modified Paths:
--------------
MacRuby/branches/icu/string.c
Modified: MacRuby/branches/icu/string.c
===================================================================
--- MacRuby/branches/icu/string.c 2010-02-26 23:39:57 UTC (rev 3634)
+++ MacRuby/branches/icu/string.c 2010-02-26 23:44:04 UTC (rev 3635)
@@ -3670,6 +3670,10 @@
// This function can be called with a NULL encoding.
enc = rb_encodings[ENCODING_UTF8];
}
+ else {
+ // People must use the bstr_ APIs to deal with binary.
+ assert(enc != rb_encodings[ENCODING_BINARY]);
+ }
rb_str_t *str = str_alloc(rb_cRubyString);
str_replace_with_bytes(str, cstr, len, enc);
return (VALUE)str;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20100226/bb681899/attachment.html>
More information about the macruby-changes
mailing list