Re: Problem with japanese systems
Re: Problem with japanese systems
- Subject: Re: Problem with japanese systems
- From: j o a r <email@hidden>
- Date: Mon, 25 Jul 2005 00:22:00 +0200
On 24 jul 2005, at 23.21, <email@hidden>
<email@hidden> wrote:
I do understand that it is not valid as a string however you can
read the
file into a string.
Says who? When you create a NSString instance you need to specify an
encoding matching the provided data. There is no
"NSMachOStringEncoding" that I know of... ;-)
I agree that NSString probably should return nil, or an exception, if
you feed it invalid data for the provided encoding - but I can also
see why you might bump into some specific sequence of bytes that
could trigger it to return an empty string.
The program in question reads this file and creates a short string of
data based on it. kind of like a hash.
Don't fight the frameworks! NSString was obviously not created to
serve as a container for random binary data, so don't try to use it
to do that. NSData on the other hand was created to serve as a
container for arbitrary bits and bytes, and would almost certainly
serve just as well as a source of data for your hashing function.
j o a r
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden