I’m using the following code to copy a string of text which contains both English and Hebrew characters into UIPasteboard.
UIPasteboard *appPasteBoard = [UIPasteboard generalPasteboard];
appPasteBoard.persistent = YES;
NSString *toCopy = [self.workingDvarTorah description];
[appPasteBoard setValue:toCopy forPasteboardType:(NSString *)kUTTypeUTF8PlainText];
I’ve implemented my own version of the description method, to copy the relevant data, here’s that:
- (NSString *)description{
// Build a string from the tags
NSMutableString *tags = [[[NSMutableString alloc] init] autorelease];
BOOL isFirstTag = YES;
for (Tag *aTag in self.tags) {
// Add a comma where necessary, but make
// sure that we're not adding a comma to
// the beginning of the first tag.
if (isFirstTag) {
isFirstTag = NO;
[tags appendFormat:@" "];
}else{
[tags appendFormat:@", "];
}
[tags appendFormat:@"%@", aTag.tagText];
}
return [NSString stringWithFormat:@"%@ \n\n %@\n\n%@: %@", self.dvarTorahTitle, self.dvarTorahContent, NSLocalizedString(@"Tags", @""), tags];
}
The text copies to the pasteboard, but when I paste it into notes or mail, certain characters, nameley the dagesh, unicode character 05BC, appears as a box, instead of the way it should. I’ve tried all of the text UTI types.
Am I doing something wrong? Is this a bug in iOS or the Notes app?
What can I do, short of stripping the offending characters, to correct the problem?
According to Wikipedia, there are two representations of Hebrew characters with dagesh in them. Apparently, there is a “combined character” and an alternate representation composed of two alternate characters. The program which created my initial data file may have used the combined character. When the data was exported again without the combined characters, the copy-paste worked.
So, it looks like there are certain characters that are unsupported by Notes and Mail for iOS.