Re: Str255 Conversion
Re: Str255 Conversion
- Subject: Re: Str255 Conversion
- From: Dietrich Epp <email@hidden>
- Date: Wed, 12 Mar 2003 15:33:17 -0800
On Wednesday, Mar 12, 2003, at 12:29 US/Pacific, Janek Priimann wrote:
Hi,
I need to convert a Str255 to an NSString. I am using voice
recognition. All is well, except for the Str255. How do I do it?
What
exactly is a Str255? I mean, I thought I knew everything :) Thanks
in
advance...
Str255 is a type definition, and is actually an array of 256 UTF-8
characters:
typedef unsigned char Str255[256];
I would think that all Str255 would be in MacRoman, or whatever
encoding the system uses, since that would keep backwards compatibility
with previous OSs.
Str255 pascalString;
mystring = [[[NSString alloc] initWith
Data:[NSData
dataWithBytes:pascalString + 1 length:*pascalString]
encoding:NSMacOSRomanStringEncoding] autorelease];
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.