Re: What is this invisible character?
Re: What is this invisible character?
- Subject: Re: What is this invisible character?
- From: Jens Alfke <email@hidden>
- Date: Tue, 18 Mar 2008 22:47:57 -0700
On 18 Mar '08, at 9:53 PM, J. Todd Slack wrote:
So how do I write out a text file in UTF16-BE encoding? Maybe this
would
solve my problem.
You *are* writing it out in that encoding; that's the problem. It's
not the default text encoding, so apps won't interpret the text
correctly. You generally want to save text files in UTF-8.
if ([predefinedSessionDocumentsFileContents writeToFile:
pathToUsersImpressionDocumentsSessionFile atomically: YES]) {}
else { NSLog (@"Failure writing Documents Session File On
Startup");
}
You want -writeToFile:atomically:encoding: instead. Pass
NSUTF8StringEncoding as the last parameter.
(I'm kind of surprised that the method you're calling generates
UTF-16. Maybe that's part of the reason it's marked as deprecated!)
—Jens
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden