• 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: Parsing .vcf files SOLVED
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Parsing .vcf files SOLVED


  • Subject: Re: Parsing .vcf files SOLVED
  • From: "Clark S. Cox III" <email@hidden>
  • Date: Thu, 17 Oct 2002 16:57:16 -0400

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


On Thursday, Oct 17, 2002, at 16:42 US/Eastern, Donald Brown wrote:

NSUnicodeStringEncoding assumes a header to the data that gives the byte
order (0xFFFE or 0xFEFF). This UTF16 doesn't include the header.

No, it doesn't, try the following code:

#import <Foundation/Foundation.h>

unsigned char testData[] = {0,'T',0,'e',0,'s',0,'t'};


int main()
{
id localPool = [NSAutoreleasePool new];
NSData *data = [NSData dataWithBytes: testData
length: sizeof testData];
NSString *test = [[[NSString alloc] initWithData: data
encoding: NSUnicodeStringEncoding] autorelease];

NSLog(@"%@", test);
[localPool release];
return 0;
}

I get the following output:

[clarkg4:~] clarkcox% cc -framework Foundation temp.m
[clarkg4:~] clarkcox% ./a.out
2002-10-17 16:56:58.380 a.out[3356] Test


- -- http://homepage.mac.com/clarkcox3/
email@hidden
Clark S. Cox, III
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (Darwin)

iEYEARECAAYFAj2vJDEACgkQd6STocYT1xW9SQCfZ9T+j8fj3D3RmMEpBa1OwsVn
Zx4Anis3fiMBBvEdnLgusJpKHFtEBg3O
=pkCe
-----END PGP SIGNATURE-----
_______________________________________________
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: Parsing .vcf files SOLVED (From: Donald Brown <email@hidden>)

  • Prev by Date: Re: How to avoid a Windows interface on OS X?
  • Next by Date: Re: Parsing .vcf files SOLVED
  • Previous by thread: Re: Parsing .vcf files SOLVED
  • Next by thread: Re: Parsing .vcf files SOLVED
  • Index(es):
    • Date
    • Thread