2012-01-02 34 views
0

我正在使用以下代碼將包含英文和希伯來文字符的文本字符串複製到UIPasteboard中。UIPasteboard副本無法在Notes和郵件中正確粘貼

UIPasteboard *appPasteBoard = [UIPasteboard generalPasteboard]; 

appPasteBoard.persistent = YES; 

NSString *toCopy = [self.workingDvarTorah description]; 

[appPasteBoard setValue:toCopy forPasteboardType:(NSString *)kUTTypeUTF8PlainText]; 

我實現我自己的描述方法的版本,複製相關資料,下面是:

- (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]; 
} 

文本複製到剪貼板,但是當我把它粘貼到筆記或電子郵件,某些字符,nameley dagesh,unicode字符05BC,顯示爲一個框,而不是它應該的方式。我試過了所有的文本UTI類型。

我做錯了什麼?這是iOS或Notes應用程序中的錯誤嗎?

我能做些什麼,短缺剝奪違規角色,糾正問題?

回答

0

According to Wikipedia,希伯來字符有兩種表示,其中有dagesh。顯然,有一個「組合字符」和一個由兩個替代字符組成的替代表示。創建我的初始數據文件的程序可能使用了組合字符。當數據再次導出而沒有組合字符時,複製粘貼工作。

因此,它看起來像Notes和Mail for iOS不支持某些字符。

相關問題