Neel
2006-03-02 14:21:49 UTC
Hi
Trying to display StandardAlert in Powerplant while localization.
Want to display simplified chinese string .i.e.Str255 dst =
"\p总阈值"; which is already converted to UTF8, using XCODE
IDE. The original en string is "Global Threshold". Now I am trying to
display it using StandardAlert in PP, but it does not display any
characters at all....Have a look at the following code snippet....
******************************************************************************
AlertStdAlertParamRec SARecord;
SInt16* outItemHit;
Str255 dst = "\p总阈值";
CFStringRef cfS = NULL;
SARecord.filterProc = nil;
SARecord.movable = true;
SARecord.helpButton = false;
SARecord.defaultText = "\pYes";;
SARecord.otherText = "\pNo";;
SARecord.cancelText = "\pCancel";;
SARecord.defaultButton = kAlertStdAlertOKButton;
SARecord.cancelButton = kAlertStdAlertCancelButton;
SARecord.position = kWindowDefaultPosition;
cfS = CFStringCreateWithPascalString(kCFAllocatorDefault, dst,
kCFStringEncodingUTF8);
ConstStringPtr uStr = CFStringGetPascalStringPtr(cfS,
CFStringGetSystemEncoding());
::StandardAlert(kAlertNoteAlert,"\pUnicode Message" ,uStr, &SARecord,
outItemHit);
********************************************************************************************************
Thanks for all help.
Regards,
Neel
Trying to display StandardAlert in Powerplant while localization.
Want to display simplified chinese string .i.e.Str255 dst =
"\p总阈值"; which is already converted to UTF8, using XCODE
IDE. The original en string is "Global Threshold". Now I am trying to
display it using StandardAlert in PP, but it does not display any
characters at all....Have a look at the following code snippet....
******************************************************************************
AlertStdAlertParamRec SARecord;
SInt16* outItemHit;
Str255 dst = "\p总阈值";
CFStringRef cfS = NULL;
SARecord.filterProc = nil;
SARecord.movable = true;
SARecord.helpButton = false;
SARecord.defaultText = "\pYes";;
SARecord.otherText = "\pNo";;
SARecord.cancelText = "\pCancel";;
SARecord.defaultButton = kAlertStdAlertOKButton;
SARecord.cancelButton = kAlertStdAlertCancelButton;
SARecord.position = kWindowDefaultPosition;
cfS = CFStringCreateWithPascalString(kCFAllocatorDefault, dst,
kCFStringEncodingUTF8);
ConstStringPtr uStr = CFStringGetPascalStringPtr(cfS,
CFStringGetSystemEncoding());
::StandardAlert(kAlertNoteAlert,"\pUnicode Message" ,uStr, &SARecord,
outItemHit);
********************************************************************************************************
Thanks for all help.
Regards,
Neel