i have an ascii textfile, delimited by '|', on the left side, there is
words that should be in latin1 encoding and the right side words that should be latin2
encoding
i read the entire file in an NSString (myString), and applied
myArray=[myString componentsSeparatedByString: @"\n"];
then
for(i=0;i<[myArray count]; i++)
{
mySecondArray=[[myArray objectAtIndex:i]componentsSeparatedByString:
@"\n"];
just to have separetly the two string and convert then to the encoding
due.
myStringOne=[mySecondArray objectAtIndex:0];
myStringTwo=[mySecondArray objectAtIndex:1];
my problem is that if I nslog the following
NSLog(@"[EMAIL PROTECTED]",mySecondArray);
I can see that I want to se (an unicode representation of the strings
in \Uxxxx format that I can put in myDict)
=("legy\U00f5z")
but if I nslog the following:
NSLog(@"[EMAIL PROTECTED]",myStringTwo, I can see something terrible.
= legyõz
in the ascci file, there are some characters in the latin2 side that I
want to replace with the
myString=[myString stringByReplacingString: @"\U00f5" withString:
@"\U0151"); command (because in the text file, I could not use unicode
characters)
but with the stuff I can see with nslog, it is impossible
I tried
myStringTwo = [myStringTwo propertyList];
but then I only get the chars until the first accented characters
=legy
and tried too:
myStringTwo = [myStringTwo UTF8String];
and got:
= legy�µz
and tried to
NSData *d = [NSData dataWithBytes: "legy�z" length: 6];
NSString s = AUTORELEASE([[NSString alloc] initWithData: d encoding:
NSLatin2StringEncoding]);
but the 's' was always 'nil'
How can I convert it to format "legy\U00f5z" in that I could replace the
characters I want and permits me to put the whole stuff in myDict?
thanks again
andras
_______________________________________________
Help-gnustep mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-gnustep