discuss-gnustep
[Top][All Lists]
Advanced

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

Parsing Property-Lists


From: Philip Mötteli
Subject: Parsing Property-Lists
Date: Sun, 11 Apr 2004 20:11:19 +0200

Hi


I have a very simple 'Localizable.strings':

"test"="Test";


When I try to use it, I have a very weird error:

<NSException: 8740f68> NAME:NSGenericException REASON:Parse failed at line 1 (char 7) - extra data after parsed string


The parsing goes through the following steps (backtrace):

#0  parsePlItem at NSString.m:5355
#1  0x40162a80 in GSPropertyList at NSString.m:5644
#2  0x4015f7f4 in -[NSString propertyList] at NSString.m:4494
#3 0x400f1dea in -[NSDictionary initWithContentsOfFile:] at NSDictionary.m:510 #4 0x400f221e in +[NSDictionary dictionaryWithContentsOfFile:] at NSDictionary.m:591


It actually parses the first part ("test") of the line correctly:

        (gdb) po result
        test

Now, 'pld' has the following values:

        (gdb) p *pld
        $13 = {ptr = 0x88e13a8, end = 15, pos = 7, lin = 1, err = 0x0}


But then the problem arises in NSString.m:5353:

        NSString.m:
        5353       if (skipSpace(pld) == YES)
        5354         {
        5355           pld->err = @"extra data after parsed string";
        5356           result = nil;         // Not at end of string.
        5357         }


'skipSpace' returns 'YES', because there's a '='. So the whole parsing is abandonned with an exception. In my eyes, this could never work, because it always will only parse the first string. So I tried to replace my 'Localizable.strings' with those of others: The same problem.


Can anybody give me a pointer?


Thanks
Phil








reply via email to

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