[macruby-changes] [4242] ControlTower/trunk/ext/CTParser/CTParser.m

source_changes at macosforge.org source_changes at macosforge.org
Fri Jun 18 14:58:37 PDT 2010


Revision: 4242
          http://trac.macosforge.org/projects/ruby/changeset/4242
Author:   joshua.ballanco at apple.com
Date:     2010-06-18 14:58:36 -0700 (Fri, 18 Jun 2010)
Log Message:
-----------
Fix for bug in parser when headers contain multibyte unicode.

Modified Paths:
--------------
    ControlTower/trunk/ext/CTParser/CTParser.m

Modified: ControlTower/trunk/ext/CTParser/CTParser.m
===================================================================
--- ControlTower/trunk/ext/CTParser/CTParser.m	2010-06-18 07:07:41 UTC (rev 4241)
+++ ControlTower/trunk/ext/CTParser/CTParser.m	2010-06-18 21:58:36 UTC (rev 4242)
@@ -143,7 +143,7 @@
 - (NSNumber *)parseData:(NSString *)dataBuf forEnvironment:(NSMutableDictionary *)env startingAt:(NSNumber *)startingPos
 {
   const char *data = [dataBuf UTF8String];
-  size_t length = [dataBuf length];
+  size_t length = [dataBuf lengthOfBytesUsingEncoding: NSUTF8StringEncoding];
   size_t offset = [startingPos unsignedLongValue];
   _parser->data = env;
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20100618/9b342929/attachment.html>


More information about the macruby-changes mailing list