Re: ASCII to hexa
Re: ASCII to hexa
- Subject: Re: ASCII to hexa
- From: Fritz Anderson <email@hidden>
- Date: Thu, 24 Jul 2003 09:47:15 -0500
First, the characters in an NSString are Unicode, not ASCII. If you
need ASCII, you will have to convert them by creating a C string with
one of NSString's methods lossyCString, dataUsingEncoding:
NSASCIIStringEncoding, or dataUsingEncoding: NSASCIIStringEncoding
allowLossyConversion: YES. Read the documentation on NSData to see how
to access the length and bytes of an NSData object.
If the Unicode characters are good enough for you, you can obtain them
through characterAtIndex:. You can then format them as hexadecimal with
[NSString stringUsingFormat: @"x", character].
-- F
On Thursday, 24 July 2003, at 4:46 AM, Julien Michel Palmas wrote:
I would like to convert NSString to hexadecimal number.
for example :
E --> 45
how should i do ??
--
Fritz Anderson - Consulting Programmer - Chicago, IL
Mail: <email@hidden>
Risumi: <
http://resume.manoverboard.org>
_______________________________________________
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: | |
| >ASCII to hexa (From: Julien Michel Palmas <email@hidden>) |