1
我认为这很基本。我有以下的代码这对我来说将文本写入一个文件:cString在iPhone上给出俄文字符时失败
float curpo = CGContextGetTextPosition(ref).x;
float newpo = 0;
float textw = 0;
const char *text = [userName cStringUsingEncoding:NSUTF8StringEncoding];
CGContextSetTextDrawingMode(ref, kCGTextInvisible);
CGContextShowTextAtPoint (ref, 0, pos, text, strlen(text));
newpo = CGContextGetTextPosition(ref).x;
textw = newpo - curpo;
它正常工作与传统的英文文本,但是当我通过在俄罗斯或其他斯拉夫字母,文字出来的所有混乱。我怎样才能解决这个问题?
正是我所需要的。谢谢。 – mostlyharmless