I have the following code to convert a String to a CFString and backwarts:
string path = @"C:\Users\ayi\Desktop\Failed\AngryBirds.ipa";
IntPtr p_path = __CFStringMakeConstantString(path);
CoreFoundation.CFString cfstring = new CoreFoundation.CFString(p_path);
string result = cfstring.ToString();
The problem is path != result
where the path
contain some Chinese characters like @"C:\Users\ayi\Desktop\中文\AngryBirds.ipa";
How can I cast string that contain Chinese to cfstring in C#?