Re: Newbie Question about Converting From NSTextField to NSData
Re: Newbie Question about Converting From NSTextField to NSData
- Subject: Re: Newbie Question about Converting From NSTextField to NSData
- From: Kyle Moffett <email@hidden>
- Date: Thu, 18 Jul 2002 11:56:26 -0400
On Thursday, July 18, 2002, at 10:42 AM, Tom Gray wrote:
>
I am reading an NSTextField and want to convert the string value
>
into an NSData type.
>
>
I know their is a better way.
If you want to keep all the fancy Unicode characters OK, then
use:
[mydata dataUsingEncoding:NSUnicodeStringEncoding
allowLossyConversion:NO]
or
[mydata dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:NO]
Both of those preserve all the characters entered, rather than
turning A into A
Hope that helps,
Kyle Moffett
_______________________________________________
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.