Foreign characters in XML
Foreign characters in XML
- Subject: Foreign characters in XML
- From: Mark Woods <email@hidden>
- Date: Mon, 07 Mar 2011 08:48:00 -0800
One of my customers is reporting that my software is failing to send XML to Final Cut Pro. Upon examining their project file I determined that it's because of foreign characters in the XML:
<key>com.apple.proapps.originalFormat</key> <size>59</size> <type>UTF8</type> <value>Apple XDCAM EX 1080i50 (débit binaire variable de 35 Mb/s)</value>
No errors are returned from the AppleEvent functions and Final Cut Pro doesn't complain - simply nothing happens. If I remove the accented e and replace it with a regular e it imports just fine. If I export the text to an XML file and then import that manually into FCP it also works fine.
What is the best method of dealing with foreign characters? I tried changing it so that it would send UTF16 text to FCP with cStringUsingEncoding:NSUTF8StringEncoding and typeUTF16ExternalRepresentation but this made no difference.
CFIndex maxBufLen = 0; maxBufLen = [xmlString lengthOfBytesUsingEncoding:kCFStringEncodingUTF8];
const char *cfStringBytes = [xmlString UTF8String];
err = AEPutParamPtr(&theEvent, kFCPXMLDataKey, typeUTF8Text, cfStringBytes, maxBufLen); // Returns noErr
Thanks, Mark. |
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Pro-apps-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden