EXIF 中无法获取俄语字母
示例 1 - 它有效
NSString *first = @"Russian letters(Русские буквы)";
[exifDictionary setValue:first forKey:(NSString*)kCGImagePropertyExifUserComment];
示例 2 - 无效
NSString *rus = @"Русские буквы";
NSString *first;
first = [[NSString alloc] initWithFormat:@"Russian letters(%@)",rus];
[exifDictionary setValue:first forKey:(NSString*)kCGImagePropertyExifUserComment];
在 EXIF 中的第二种情况下写“俄语字母(????????? ??????)” 如果 NSString 包含参数,则会发生这种情况。 如何使用带有参数的 NSString 获得正确的俄语字母?
也许问题是字典的下一个保存?
[exifDictionary setValue:[NSString stringWithFormat:@"Russian letters(%@)",rus] forKey:(NSString*)kCGImagePropertyExifUserComment];
或者
[exifDictionary setValue:first forKey:(NSString*)kCGImagePropertyExifUserComment];
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];
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在代码中使用 UTF8 硬编码字符串并不安全。
请参阅苹果关于 格式化字符串对象。
我想您可以使用该代码作为解决方法:
或者如果这也不起作用,那么您始终可以使用纯 C 来执行格式化:
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: