• 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: 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] initWithData:[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.
References: 
 >Re: Str255 Conversion (From: Janek Priimann <email@hidden>)

  • Prev by Date: Re: Creating a Singleton Object
  • Next by Date: RE: Re[2]: What's with 'dark' @implementation?
  • Previous by thread: Re: Str255 Conversion
  • Next by thread: RE: Str255 Conversion
  • Index(es):
    • Date
    • Thread