• 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: Problem with japanese systems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Re: Problem with japanese systems (From: <email@hidden>)

  • Prev by Date: Re: Which Frameworks? /Developer/SDK 10.4/System/Library/Frameworks vs System/Library/Frameworks
  • Next by Date: Add record to NSDictionary
  • Previous by thread: Re: Problem with japanese systems
  • Next by thread: Fwd: Problem with japanese systems
  • Index(es):
    • Date
    • Thread