AVMetadataItem的编码 [英] Encoding of AVMetadataItem
本文介绍了AVMetadataItem的编码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我尝试将该字符串转换为原始UTF8,然后使用CP1251编码创建一个新字符串 - 没有运气,结果为零。尝试使用item.dataValue - 没有骰子,它包含一个原始列表数据(从bplist ...开始)。
任何想法都非常赞赏。
提前感谢
解决方案
我最终使用了Mike Ash的NSPropertyListReader_binary1和获取原始数据,然后调整它,以便NSString它是编码。
可怕 - 但工作。
I have a AVMetadataItem which has fields encoded in CP1251 (Cyrillic). After reading item.stringValue I get garbage - incorrectly encoded string. I've tried converting that string to raw UTF8 and then creating a new string using the CP1251 encoding - no luck, result is nil. Tried taking the item.dataValue - no dice, it contains a raw list data (starting with bplist...).
Any ideas are very appreciated.
Thanks in advance.
解决方案
I've ended up using Mike Ash's NSPropertyListReader_binary1 and getting the raw data and then mangling it so that NSString would it it's encoding.
Horrible - but worked.
这篇关于AVMetadataItem的编码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文