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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to