diff -u CamelBones.orig/CBPerl.m CamelBones.new/CBPerl.m --- CamelBones.orig/CBPerl.m Fri Jun 13 21:34:55 2003 +++ CamelBones.new/CBPerl.m Fri Jun 13 21:23:39 2003 @@ -91,7 +91,7 @@ } - (id) eval: (NSString *)perlCode { - SV *result = eval_pv([perlCode cString], TRUE); + SV *result = eval_pv([perlCode UTF8String], TRUE); // Check for an error if (SvTRUE(ERRSV)) { @@ -107,28 +107,28 @@ } - (long) varAsInt: (NSString *)perlVar { - return SvIV(get_sv([perlVar cString], TRUE)); + return SvIV(get_sv([perlVar UTF8String], TRUE)); } - (void) setVar: (NSString *)perlVar toInt: (long)newValue { - sv_setiv_mg(get_sv([perlVar cString], TRUE), newValue); + sv_setiv_mg(get_sv([perlVar UTF8String], TRUE), newValue); } - (double) varAsFloat: (NSString *)perlVar { - return SvNV(get_sv([perlVar cString], TRUE)); + return SvNV(get_sv([perlVar UTF8String], TRUE)); } - (void) setVar: (NSString *)perlVar toFloat: (double)newValue { - sv_setnv_mg(get_sv([perlVar cString], TRUE), newValue); + sv_setnv_mg(get_sv([perlVar UTF8String], TRUE), newValue); } - (NSString *) varAsString: (NSString *)perlVar { STRLEN n_a; - return [NSString stringWithCString: SvPV(get_sv([perlVar cString], TRUE), n_a)]; + return [NSString stringWithUTF8String: SvPV(get_sv([perlVar UTF8String], TRUE), n_a)]; } - (void) setVar: (NSString *)perlVar toString: (NSString *)newValue { - sv_setpv_mg(get_sv([perlVar cString], TRUE), [newValue cString]); + sv_setpv_mg(get_sv([perlVar UTF8String], TRUE), [newValue UTF8String]); } - (void) useLib: (NSString *)libPath { diff -u CamelBones.orig/CBPerlGuts.m CamelBones.new/CBPerlGuts.m --- CamelBones.orig/CBPerlGuts.m Fri Jun 13 21:34:56 2003 +++ CamelBones.new/CBPerlGuts.m Fri Jun 13 21:23:39 2003 @@ -71,7 +71,7 @@ // and strings } else if (SvPOK(sv)) { - return [NSString stringWithCString: SvPV(sv, PL_na)]; + return [NSString stringWithUTF8String: SvPV(sv, PL_na)]; // and arrays } else if (SvTYPE((AV*)sv) == SVt_PVAV) { @@ -101,8 +101,8 @@ // Some types of objects get special handling else if ([target isKindOfClass: [NSString class]]) { - SV *newSV = newSVpv([(NSString *)target cString], [(NSString *)target length]); - return newSV; + SV *newSV = newSVpv([(NSString *)target UTF8String], 0); + return newSV; } // If it's a descendant of NSObject, create and return a wrapper @@ -116,7 +116,7 @@ } SV* CBWrappedConstant(SV* constantName) { - NSString* name = [NSString stringWithCString: SvPV(constantName, PL_na)]; + NSString* name = [NSString stringWithUTF8String: SvPV(constantName, PL_na)]; if ([name isEqualToString: @"NSFontAttributeName"]) return CBCreateWrapperObject(NSFontAttributeName); @@ -157,7 +157,7 @@ SV* CBCreateObjectOfClass(NSString *className) { HV *hv = newHV(); SV *ret = newRV_inc((SV *)hv); - sv_bless(ret, gv_stashpv([className cString], 0)); + sv_bless(ret, gv_stashpv([className UTF8String], 0)); return ret; } @@ -183,14 +183,14 @@ NSMethodSignature *ms = [target methodSignatureForSelector: sel]; NSInvocation *inv = [NSInvocation invocationWithMethodSignature: ms]; - NSString *returnType = [NSString stringWithCString: [ms methodReturnType]]; + NSString *returnType = [NSString stringWithUTF8String: [ms methodReturnType]]; NSString *selName = NSStringFromSelector(sel); [inv setTarget: target]; [inv setSelector: sel]; for(i=2; i < [ms numberOfArguments]; i++) { - NSString *argType = [NSString stringWithCString: [ms getArgumentTypeAtIndex: i]]; + NSString *argType = [NSString stringWithUTF8String: [ms getArgumentTypeAtIndex: i]]; AV *av = (AV *)SvRV(args); SV **sv = av_fetch(av, i-2, 0); SV *argSV = sv ? *sv : NULL; @@ -257,7 +257,7 @@ } } else if ([argType isEqualToString: @":"]) { - NSString *stringArg = [NSString stringWithCString: SvPV(argSV, PL_na)]; + NSString *stringArg = [NSString stringWithUTF8String: SvPV(argSV, PL_na)]; SEL selArg = NSSelectorFromString(stringArg); [inv setArgument: &selArg atIndex: i]; @@ -367,7 +367,7 @@ [ms deleteCharactersInRange: all]; } - if (gv_fetchmethod(stash, [ms cString]) != NULL) { + if (gv_fetchmethod(stash, [ms UTF8String]) != NULL) { return ms; } else { return nil; @@ -402,7 +402,7 @@ [ms deleteCharactersInRange: all]; } - if (gv_fetchmethod(stash, [ms cString]) != NULL) { + if (gv_fetchmethod(stash, [ms UTF8String]) != NULL) { return params; } else { return @""; @@ -435,7 +435,7 @@ [ms deleteCharactersInRange: all]; } - if (gv_fetchmethod(stash, [ms cString]) != NULL) { + if (gv_fetchmethod(stash, [ms UTF8String]) != NULL) { if ([ms hasPrefix: @"get"]) { return @"@"; } else { @@ -613,7 +613,7 @@ buf = malloc([methodSignature frameLength]); if (!buf) return; - selCString = [NSStringFromSelector([anInvocation selector]) cString]; + selCString = [NSStringFromSelector([anInvocation selector]) UTF8String]; // Get a string for the selector selString = newSVpv(selCString, 0); @@ -629,7 +629,7 @@ break; // Try to get %OBJC_METHOD_SIGNATURES out of the appropriate package - methodSignaturesHash = get_hv([[NSString stringWithFormat: @"%@::OBJC_METHOD_SIGNATURES", className] cString], NO); + methodSignaturesHash = get_hv([[NSString stringWithFormat: @"%@::OBJC_METHOD_SIGNATURES", className] UTF8String], NO); if (!methodSignaturesHash) break; @@ -685,7 +685,7 @@ return; // Get the entry for this method name - methodName = [CBGetMethodNameForSelector(sv, [anInvocation selector]) cString]; + methodName = [CBGetMethodNameForSelector(sv, [anInvocation selector]) UTF8String]; if (!methodName) { const char *rt = [methodSignature methodReturnType]; diff -u CamelBones.orig/CBPerlObject.m CamelBones.new/CBPerlObject.m --- CamelBones.orig/CBPerlObject.m Fri Jun 13 21:34:56 2003 +++ CamelBones.new/CBPerlObject.m Fri Jun 13 21:23:39 2003 @@ -35,7 +35,7 @@ - (CBPerlObject *) initNamedObject: (NSString *)varName { // Get the named SV - SV *obj = get_sv([varName cString], FALSE); + SV *obj = get_sv([varName UTF8String], FALSE); // Is it an object reference? if (obj && sv_isobject(obj)) { @@ -53,7 +53,7 @@ deref = SvRV((SV *)_sv); stash = SvSTASH(deref); packageName = HvNAME(stash); - className = [[NSString alloc] initWithCString: packageName]; + className = [[NSString alloc] initWithUTF8String: packageName]; return self; } @@ -73,7 +73,7 @@ // Check for named properties, and get/set their values - (BOOL) hasProperty: (NSString *)propName { - if (hv_exists((HV*)_hv, [propName cString], [propName length])) { + if (hv_exists((HV*)_hv, [propName UTF8String], [propName length])) { return TRUE; } else { return FALSE; @@ -81,7 +81,7 @@ } - (id) getProperty: (NSString *)propName { - SV** propPointer = hv_fetch((HV*)_hv, [propName cString], [propName length], 0); + SV** propPointer = hv_fetch((HV*)_hv, [propName UTF8String], [propName length], 0); if (propPointer) { return CBDerefSVtoID((SV*) *propPointer); } else { @@ -91,7 +91,7 @@ - (void) setProperty: (NSString *)propName toObject: (id)propValue { SV *propSV = CBDerefIDtoSV(propValue); - hv_store((HV*)_hv, [propName cString], [propName length], propSV, 0); + hv_store((HV*)_hv, [propName UTF8String], [propName length], propSV, 0); } - (void) dealloc { @@ -151,7 +151,7 @@ m = class_getInstanceMethod(self->isa, aSelector); if (m) { cEncoding = m->method_types; - encoding = [NSString stringWithCString: cEncoding]; + encoding = [NSString stringWithUTF8String: cEncoding]; } else { @@ -175,7 +175,7 @@ [encoding appendString: @"@:"]; [encoding appendString: argEncoding]; - return [NSMethodSignature signatureWithObjCTypes: [encoding cString]]; + return [NSMethodSignature signatureWithObjCTypes: [encoding UTF8String]]; } @end diff -u CamelBones.orig/CBPerlScalar.m CamelBones.new/CBPerlScalar.m --- CamelBones.orig/CBPerlScalar.m Fri Jun 13 21:34:57 2003 +++ CamelBones.new/CBPerlScalar.m Fri Jun 13 21:23:39 2003 @@ -52,7 +52,7 @@ // Returns a handle to a Perl scalar named varName. // Returns nil of no such scalar exists. - (CBPerlScalar *) initNamedScalar: (NSString *)varName { - SV *newSV = get_sv([varName cString], FALSE); + SV *newSV = get_sv([varName UTF8String], FALSE); if (newSV != NULL) { self = [super init]; @@ -68,7 +68,7 @@ // created scalar will be initialized to Perl's undef. // Returns nil if the named object does not exist, and could not be created - (CBPerlScalar *) initNamedScalar: (NSString *)varName withDefaultString: (NSString *)def { - SV *newSV = get_sv([varName cString], FALSE); + SV *newSV = get_sv([varName UTF8String], FALSE); if (newSV != NULL) { self = [super init]; @@ -76,10 +76,10 @@ return self; } else { - newSV = get_sv([varName cString], TRUE); + newSV = get_sv([varName UTF8String], TRUE); if (newSV != NULL) { _sv = newSV; - sv_setpv_mg(_sv, [def cString]); + sv_setpv_mg(_sv, [def UTF8String]); return self; } else { return nil; @@ -87,7 +87,7 @@ } } - (CBPerlScalar *) initNamedScalar: (NSString *)varName withDefaultInteger: (long)def { - SV *newSV = get_sv([varName cString], FALSE); + SV *newSV = get_sv([varName UTF8String], FALSE); if (newSV != NULL) { self = [super init]; @@ -95,7 +95,7 @@ return self; } else { - newSV = get_sv([varName cString], TRUE); + newSV = get_sv([varName UTF8String], TRUE); if (newSV != NULL) { _sv = newSV; sv_setiv_mg(_sv, def); @@ -106,7 +106,7 @@ } } - (CBPerlScalar *) initNamedScalar: (NSString *)varName withDefaultDouble: (double)def { - SV *newSV = get_sv([varName cString], FALSE); + SV *newSV = get_sv([varName UTF8String], FALSE); if (newSV != NULL) { self = [super init]; @@ -114,7 +114,7 @@ return self; } else { - newSV = get_sv([varName cString], TRUE); + newSV = get_sv([varName UTF8String], TRUE); if (newSV != NULL) { _sv = newSV; sv_setnv_mg(_sv, def);