Re: Str255 Conversion
Re: Str255 Conversion
- Subject: Re: Str255 Conversion
- From: Dave Thorup <email@hidden>
- Date: Wed, 12 Mar 2003 13:53:27 -0700
On 3/12/03 12:12 PM, "Craig Bakalian" <email@hidden> 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...
Try the CoreFoundation function (from CFString.h)
CFStringRef CFStringCreateWithPascalString(CFAllocatorRef alloc,
ConstStr255Param pStr,
CFStringEncoding encoding);
Example:
ConstStr255Param pPascalString = ...; // whatever here
NSString* s = (NSString *)CFStringCreateWithPascalString(NULL,
pPascalString,
CFStringGetSystemEncoding());
ConstStr255Param is defined as (from CFBase.h):
typedef const unsigned char * ConstStringPtr;
____________________________________
Dave Thorup
Software Engineer
email@hidden
voice: 801-805-9422
www.corda.com
Interactive data driven graphics.
_______________________________________________
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.