Bingo.  Completely and utterly solved.  Thanks Gus!

I was writing to the file with:

[[textStream dataUsingEncoding:NSUTF8StringEncoding] writeToFile:[sheet 
filename] atomically:YES];

Now, I'm writing with:

[textStream writeToFile:[sheet filename] atomically:YES 
encoding:NSUTF8StringEncoding error:&error];

When using the latter, TextEdit picks up the encoding, no problem.

On 2010-05-21, at 12:48 PM, Gus Mueller wrote:

> On May 21, 2010, at 12:42 PM, K.Darcy Otto wrote:
> 
>> [textStream appendFormat:@"%C%C%C",0x00EF,0x00BB,0x00BF]; // textStream is 
>> an empty NSMutableString that gets added to, and then written to a file
> 
> 
> How are you writing the string to a file?  Are you using NSString's 
> writeToFile:atomically:?  I'm pretty sure that doesn't write it out as UTF8.  
> You'll probably want to use writeToFile:atomically:encoding:error: with 
> NSUTF8StringEncoding as the encoding if you aren't already.
> 
> -gus
> 
> --  
> 
> August 'Gus' Mueller
> Flying Meat Inc.
> http://flyingmeat.com/
> 
_______________________________________________

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 arch...@mail-archive.com

Reply via email to