FROM : Clark Cox
DATE : Wed Dec 22 21:04:02 2004
On Wed, 22 Dec 2004 20:10:02 +0100, Christoffer Lerno <<email_removed>> wrote:
> I'm (among other things) using the filename as a dictionary key. Since
> the filenames are byte-wise different, isEqualToString: fails where a
> compare: would succeed, which in turn makes it impossible for me to
> retrieve the dictionary value unless I can make sure the dictionary key
> and the key I use actually do satisfy isEqualToString:
OK, now it makes sense. Just normalize the string before you use it as a key.
That is, replace calls like:
[myDictionary objectForKey: string];
[myDictionary setObject: object forKey: string];
with calls like:
[myDictionary objectForKey: [string decomposedStringWithCanonicalMapping]];
[myDictionary setObject: object forKey: [string
decomposedStringWithCanonicalMapping]];
--
Clark S. Cox III
<email_removed>
http://www.livejournal.com/users/clarkcox3/
http://homepage.mac.com/clarkcox3/
DATE : Wed Dec 22 21:04:02 2004
On Wed, 22 Dec 2004 20:10:02 +0100, Christoffer Lerno <<email_removed>> wrote:
> I'm (among other things) using the filename as a dictionary key. Since
> the filenames are byte-wise different, isEqualToString: fails where a
> compare: would succeed, which in turn makes it impossible for me to
> retrieve the dictionary value unless I can make sure the dictionary key
> and the key I use actually do satisfy isEqualToString:
OK, now it makes sense. Just normalize the string before you use it as a key.
That is, replace calls like:
[myDictionary objectForKey: string];
[myDictionary setObject: object forKey: string];
with calls like:
[myDictionary objectForKey: [string decomposedStringWithCanonicalMapping]];
[myDictionary setObject: object forKey: [string
decomposedStringWithCanonicalMapping]];
--
Clark S. Cox III
<email_removed>
http://www.livejournal.com/users/clarkcox3/
http://homepage.mac.com/clarkcox3/
| Related mails | Author | Date |
|---|---|---|
| Christoffer Lerno | Dec 20, 18:01 | |
| Clark Cox | Dec 20, 20:10 | |
| Jeremy Dronfield | Dec 20, 23:11 | |
| Brendan Younger | Dec 20, 23:29 | |
| Andrew Farmer | Dec 21, 00:04 | |
| Christoffer Lerno | Dec 21, 12:20 | |
| Clark Cox | Dec 21, 15:27 | |
| Christoffer Lerno | Dec 22, 10:41 | |
| Christoffer Lerno | Dec 22, 10:56 | |
| Jeremy Dronfield | Dec 22, 15:03 | |
| Clark Cox | Dec 22, 17:30 | |
| Clark Cox | Dec 22, 17:35 | |
| Jeremy Dronfield | Dec 22, 18:54 | |
| Christoffer Lerno | Dec 22, 20:03 | |
| Christoffer Lerno | Dec 22, 20:10 | |
| Clark Cox | Dec 22, 20:30 | |
| Andreas Mayer | Dec 22, 20:35 | |
| Clark Cox | Dec 22, 21:04 | |
| Christoffer Lerno | Dec 23, 10:53 |






Cocoa mail archive

