objective c - Converting to Precomposed Unicode String using Python-AppKit-ObjectiveC -


This document tells Apple a method of converting a Unicode string written with a degraded version. Since I have a problem with the file name is a few letters (like a tone grave), I want to try the conversion function

Zero CFStringNormalize (CFMutableStringRef theString, CFStringNormalizationForm theForm);

I am using it with Python and Epikit Library. If I pass a python string as an argument, I get:

corf.conf.confirmation ("ABC", 0) 2009-04- 27 21: 00: 54.314 Python [4519: 613] * - [OC_PythonString _cfNormalize:]: Unrecognized Selector Example 0x1f02510 Traceback (Most Recent Call Sent): File "", Line 1, in ValueError: NSInvalidArgumentException - * - [OC_PythonString _cfNormalize:]: Example sent to unknown selector 0x1f02510

I think Because this is a CFMutableStringRef as an argument, how do I convert a python string into CFMutableStringRef?

OC_PythonString (which is what Python strings have been bridged) is an NSString subclass, so that you have a With NSMutableString ..

mutableString = NSMutableString.alloc () initWithString _ ("abc")

Then use CFStringNormalize to use mutableString as argument

< / Div>

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -