discuss-gnustep
[Top][All Lists]
Advanced

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

NSString (NSUTF8StringEncoding) does not work anymore


From: Andreas Hoeschler
Subject: NSString (NSUTF8StringEncoding) does not work anymore
Date: Fri, 31 Jan 2003 23:35:10 +0100

Hi all,

I downloaded the latest cvs today (last time is already a few weeks ago). Since the last upgrade I have poblems with NSString and NSUTF8StringEncoding. Has anybody altered this code in the last 8 weeks? The following code fragment works on MacOSX and I believe also worked on GNUstep (before my latest upgrade)

NSData *unicodeData = [NSData dataWithContentsOfFile:@"test5.data"]; NSString *unicodeStr = [[NSString alloc] initWithData:unicodeData encoding:NSUTF8StringEncoding];
      NSLog(@"unicodeData %@", [unicodeData description]);
      NSLog(@"unicodeStr %d '%@'", [unicodeData length], unicodeStr);

2003-01-31 23:25:26.620 FBTest[10940] unicodeData <4c532034 37363131 20626973 20343736 31362061 6c73204c c3a42061 62676572 6563686e 65742e20 536f7274 696d656e 74206c74 2e205374 7265636b 656e6765 736368c3 a4667420 69737420 4b696566 65722e20 44696666 6572656e 7a203235 392c3220 526d2078 20302c35 30e282ac 203d2031 32392c36 e282ac> 2003-01-31 23:25:26.620 FBTest[10940] unicodeStr 123 'LS 47611 bis 47616 als L\\344 abgerechnet. Sortiment lt. Streckengesch\\344ft ist Kiefer. Differenz 259,2 Rm x 0,50\\u20ac = 129,6\\u20ac'

This is what I expect. Now after upgrading, on GNUstep I get

bash-2.03$ ./FBTest
2003-01-31 23:27:55.138 FBTest[24323] unicodeData <4c532034 37363131 20626973 20343736 31362061 6c73204c c3a42061 62676572 6563686e 65742e20 536f7274 696d656e 74206c74 2e205374 7265636b 656e6765 736368c3 a4667420 69737420 4b696566 65722e20 44696666 6572656e 7a203235 392c3220 526d2078 20302c35 30e282ac 203d2031 32392c36 e282ac>
2003-01-31 23:27:55.146 FBTest[24323] unicodeStr 123 '(nil)'

What is wrong here? I am attaching the file containing the data in question. The text contains a euro sign. Could this cause the problem?

Attachment: test5.data
Description: Binary data



Regards,

   Andreas

reply via email to

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