2017-06-16 2 views
0

アラビア語のローカル通知を発すると、私は奇妙な文字に直面しています。その結果、下の図のように間違った文字が表示されます。Xcode iOSでプッシュ通知を発すると奇妙な文字

enter image description here

は文がアラビア語ローカライズplistファイルにparceledています。 PLISTおよびその他のcppファイルはUTF-8でエンコードされている...ここplistファイル

PushLocalNotif((CCLocalizedString("Notif1"), 2); 


void PushLocalNotif(const char* string,int day) { 
UILocalNotification *notification = [[UILocalNotification alloc]init]; 
notification.repeatInterval = NSDayCalendarUnit; 
[notification setAlertBody:[NSString stringWithFormat:@"%s",string]]; 
//[notification setFireDate:[NSDate dateWithTimeIntervalSinceNow:60*60*24*day]]; 
[notification setFireDate:[NSDate dateWithTimeIntervalSinceNow:60/* * 60 * day*/]]; 
[notification setTimeZone:[NSTimeZone defaultTimeZone]]; 
[[UIApplication sharedApplication] scheduleLocalNotification:notification]; 
} 

以下PushLocalNotifの機能とNOTIF文でローカライズされたplistファイルに個別ののコードです。 enter image description here

私は間違っては、文字をコードに関連したものです確信しているが、私はその文をコード化するための方法を見つけることができません:(

答えて

1

代わり[notification setAlertBody: [NSString stringWithCString:string encoding:NSUTF8StringEncoding]];を行うようにしてください。

+0

驚くべきことだそれ!それありがとうgskbyte !!! –

関連する問題