bug-gnustep
[Top][All Lists]
Advanced

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

Missing encodings in Unicode.m


From: Alexander Malmberg
Subject: Missing encodings in Unicode.m
Date: Thu, 07 Mar 2002 23:18:01 +0100

Hi,

iconv_stringforencoding() in Unicode.m isn't handling all string
encodings found in NSString.h. I've attached a patch that adds the rest
of the iso-8859 encodings, but this still leaves:

NSSymbolStringEncoding
NSNonLossyASCIIStringEncoding
NSProprietaryStringEncoding
NSUTF7StringEncoding
NSGSM0338StringEncoding

unaccounted for. (I guess only utf7 is really an issue, though.)

Also, should [NSString -initWithData: encoding:] really return an empty
string on failure? This makes error recovery tricky (eg. when decoding
messages in Pantomime, we'd like to detect this and tell the user). To
me it makes more sense to return nil.

- Alexander Malmberg
Index: Source/Unicode.m
===================================================================
RCS file: /cvsroot/gnustep/gnustep/core/base/Source/Unicode.m,v
retrieving revision 1.35
diff -u -r1.35 Unicode.m
--- Source/Unicode.m    24 Jan 2002 17:54:33 -0000      1.35
+++ Source/Unicode.m    7 Mar 2002 21:59:53 -0000
@@ -364,6 +364,18 @@
        return "ISO-8859-7";
       case NSISOHebrewStringEncoding:
        return "ISO-8859-8";
+
+      case NSISOLatin5StringEncoding: 
+       return "ISO-8859-9";
+      case NSISOLatin6StringEncoding: 
+       return "ISO-8859-10";
+      case NSISOLatin7StringEncoding: 
+       return "ISO-8859-13";
+      case NSISOLatin8StringEncoding: 
+       return "ISO-8859-14";
+      case NSISOLatin9StringEncoding: 
+       return "ISO-8859-15";
+
       case NSGB2312StringEncoding:
        return "EUC-CN";
       default:


reply via email to

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