XML tags as characters in InDesign 5.5
XML tags as characters in InDesign 5.5
- Subject: XML tags as characters in InDesign 5.5
- From: Chris Paveglio <email@hidden>
- Date: Fri, 12 Apr 2013 17:20:39 +0000
- Thread-topic: XML tags as characters in InDesign 5.5
I¹ve found they are particularly problematic. I¹ve had them infect my output
until I found a way to get rid of them. Their unicode signature is 0xFEFF,
even for opening and closing tags it seems.
In Applescript I did this:
set unicodeTagChar to «data utxtFEFFFEFF»
set unicodeTagChar to unicodeTagChar as Unicode text
Then I had a function to replace characters I used later:
set finalXMLString to replaceText(finalXMLString, unicodeTagChar, "")
In my blended ASOC/Cocoa app I use a Cocoa method since I like using Cocoa
more whenever I can:
+(NSString *)stripText:(NSString *)theText
{
//specifically for removing the unicodeTagChar from some text
UniChar chars[] = {0xFEFF};
NSString *string = [NSString stringWithCharacters:chars length:1];
return [theText stringByReplacingOccurrencesOfString:string
withString:@""];
}
HTH,
Chris
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden