discuss-gnustep
[Top][All Lists]
Advanced

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

Re: KVC


From: Richard Frith-Macdonald
Subject: Re: KVC
Date: Wed, 6 Jun 2007 08:54:22 +0100


On 5 Jun 2007, at 23:14, Chris Farber wrote:

On May 31, 2007, at 4:20 PM, Helge Hess wrote:

Ok,

found another thing ;-) GNUstep KVC breaks with Unicode keys! Eg:

  [self takeValue:urks forKey:@"Helge Heß"];

produces an exception because the ß can't be converted to ASCII. I recommend switching the conversion to UTF-8.

I don't believe this is an issue, as you cannot use unicode for variables or method names.


Please remember that KVC is not just for accessing methods but for arbitary key/value combinations.

Perhaps you are thinking of NSMutableDictionary? KVC is only for setting properties via appropriately named methods or direct access to instance variables.

Good point ... using non-ascii keys cannot ever work.

However, we should try to make sure that the mode of failure matches that of the MacOS-X implementation ... what does MacOS-X do when it is given an unusable key? Since Helge raised this issue, my guess is that MacOS-X fails quietly in some way rather than raising an exception. Changing the code to use UTF-8 as he suggests might be the best way to mimic MacOS-X behavior.

Anyway, the first step is to write some testcases for using the various KVC methods with non-ascii keys and run them on MacOS-X to see how they 'should' perform. After that you may want to modify GNUstep-base to match where necessary. .





reply via email to

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