example 1 - it works
NSString *first = @"Russian letters(Русские буквы)";
[exifDictionary setValue:first forKey:(NSString*)kCGImagePropertyExifUserComment];
example 2 - doesn't work
NSString *rus = @"Русские буквы";
NSString *first;
first = [[NSString alloc] initWithFormat:@"Russian letters(%@)",rus];
[exifDictionary setValue:first forKey:(NSString*)kCGImagePropertyExifUserComment];
In second case in EXIF write "Russian letters(??????? ?????)" if NSString contains parameter its happens. how can I get correct russian letters use NSString with parameter?
maybe problem is the next saving at dictionary?
[exifDictionary setValue:[NSString stringWithFormat:@"Russian letters(%@)",rus] forKey:(NSString*)kCGImagePropertyExifUserComment];
or
[exifDictionary setValue:first forKey:(NSString*)kCGImagePropertyExifUserComment];
Using UTF8 hard-coded strings in code isn't safe. See apple's article about Formatting String Objects.
I suppose that you can use that code as workaround:
Or if that doesn't work either, so, you can always use plain C to perform formatting: