• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Str255 Conversion
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Str255 Conversion (From: Craig Bakalian <email@hidden>)

  • Prev by Date: Carriage Return
  • Next by Date: Re: Str255 Conversion
  • Previous by thread: Re: Str255 Conversion
  • Next by thread: Re: Str255 Conversion
  • Index(es):
    • Date
    • Thread