bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSString patches


From: Alexander Malmberg
Subject: NSString patches
Date: Mon, 18 Mar 2002 01:26:49 +0100

Hi,

The recent changes in the string encoding code broke a few things. I've
attached a patch that fixes the ones I spotted, and things seem to work
now.

I've used a bunch of tests I wrote for Pantomime a while back to test
this (since they deal a lot with string encoding and decoding). Might be
useful for others working on it (I could send it to anyone who's
interested). (Adding them to the gnustep test suite might be better; I
could give that a try too.)

- Alexander Malmberg
Index: GSString.m
===================================================================
RCS file: /cvsroot/gnustep/gnustep/core/base/Source/GSString.m,v
retrieving revision 1.47
diff -u -r1.47 GSString.m
--- GSString.m  16 Mar 2002 09:54:50 -0000      1.47
+++ GSString.m  18 Mar 2002 00:09:22 -0000
@@ -1630,6 +1630,7 @@
       self->_contents.u = tmp;
       self->_flags.wide = 1;
       self->_count = len;
+      self->_capacity = len;
     }
 
   return other;
Index: NSString.m
===================================================================
RCS file: /cvsroot/gnustep/gnustep/core/base/Source/NSString.m,v
retrieving revision 1.249
diff -u -r1.249 NSString.m
--- NSString.m  16 Mar 2002 09:54:50 -0000      1.249
+++ NSString.m  18 Mar 2002 00:09:23 -0000
@@ -1215,7 +1215,7 @@
       unsigned         l = 0;
 
       b = (unsigned char*)[data bytes];
-      if (GSToUnicode(&u, &l, b, len, NSUTF8StringEncoding, GSObjCZone(self),
+      if (GSToUnicode(&u, &l, b, len, encoding, GSObjCZone(self),
        0) == NO)
        {
          DESTROY(self);
Index: Unicode.m
===================================================================
RCS file: /cvsroot/gnustep/gnustep/core/base/Source/Unicode.m,v
retrieving revision 1.40
diff -u -r1.40 Unicode.m
--- Unicode.m   16 Mar 2002 09:54:50 -0000      1.40
+++ Unicode.m   18 Mar 2002 00:09:23 -0000
@@ -1625,7 +1625,6 @@
              if (rval == (size_t)-1 && errno != E2BIG)
                {
                  result = NO;
-                 iconv_close(cd);
                  break;
                }
              dpos = (bsize * sizeof(unichar) - outbytesleft) / sizeof(unichar);

reply via email to

[Prev in Thread] Current Thread [Next in Thread]