Transliterate/transpose the characters in the NSString

前端 未结 3 826
不思量自难忘°
不思量自难忘° 2021-02-02 17:59

I want to transliterate a cyrillic string to it\'s closest latin equivalent. E.g. \"матрешка\" => \"matreshka\", \"водка\" => \"vodka\". So ideally I want some ready to use meth

3条回答
  •  囚心锁ツ
    2021-02-02 18:44

    If you don't need diacritics or accents you can call CFStringTransform(bufferRef, NULL, kCFStringTransformStripCombiningMarks, false);

    Additional article: http://nshipster.com/cfstringtransform/

提交回复
热议问题