[macruby-changes] [5190] MacRuby/trunk/string.c

source_changes at macosforge.org source_changes at macosforge.org
Tue Jan 25 13:16:25 PST 2011


Revision: 5190
          http://trac.macosforge.org/projects/ruby/changeset/5190
Author:   vincent.isambart at gmail.com
Date:     2011-01-25 13:16:25 -0800 (Tue, 25 Jan 2011)
Log Message:
-----------
fixed a small regression for non-ASCII bytes in ASCII-8BIT strings
that were displayed as if they were ISO-8859-1 by String#inspect

Modified Paths:
--------------
    MacRuby/trunk/string.c

Modified: MacRuby/trunk/string.c
===================================================================
--- MacRuby/trunk/string.c	2011-01-25 11:45:01 UTC (rev 5189)
+++ MacRuby/trunk/string.c	2011-01-25 21:16:25 UTC (rev 5190)
@@ -2842,6 +2842,9 @@
     __block UChar32 prev = 0;
     str_each_uchar32(str, ^(UChar32 c, long start_index, long char_len, bool *stop) {
 	bool print = iswprint(c);
+	if (IS_BINARY_ENC(str->encoding) && c > 127) {
+	    print = false;
+	}
 	if (dump && prev == '#') {
 	    inspect_append(result, prev, (c == '$' || c == '@' || c == '{'));
 	}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20110125/0cbd4344/attachment.html>


More information about the macruby-changes mailing list