Filenames with Umlauts
Filenames with Umlauts
- Subject: Filenames with Umlauts
- From: "Gerriet M. Denkmann" <email@hidden>
- Date: Sat, 5 Jul 2003 11:28:30 +0200
Currently I use this (rather lengthy) way to get a file:
NSBundle *mainBundle = [ NSBundle mainBundle ] ;
// the @ in the next line is a a-umlaut, aka 'latin small letter a with
diaresis'; cocoa-dev can not handle unicode.
// this works, because my source file is in utf-8 format.
const char bear_utf8[] = "B@r" ; // a German animal
NSString *bear_precomp = [ NSString stringWithUTF8String: bear_utf8 ] ;
NSString *bear_decomp = [ bear_precomp
decomposedStringWithCanonicalMapping ];
// the bear is now called: "Ba 'combining diaresis' r"
NSString *bear_path = [ mainBundle pathForResource: bear_decomp
ofType: nil ] ;
Is there a shorter or better way to get at my bear?
Is decomposedStringWithCanonicalMapping the correct method?
There is also decomposedStringWithCompatibilityMapping (which uses the
Unicode Normalization Form KD, as opposed to Normalization Form D).
What is the difference, and which method is used in the file system?
Gerriet.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.