Re: Saving UTF-8 as File
Re: Saving UTF-8 as File
- Subject: Re: Saving UTF-8 as File
- From: John Stiles <email@hidden>
- Date: Tue, 19 Apr 2005 11:44:34 -0700
On Apr 19, 2005, at 11:26 AM, Jim Hamilton wrote:
Can someone point me in the right direction to be able to save the
HTML string as a UTF-8 encoded file?
1) Do you start the file with a BOM? (Check unicode.org to be sure,
but I think it's 0xEF 0xBB 0xBF.)
2) Does your HTML have an encoding tag? ("charset=utf-8" in a meta
tag)
I don't know if #1 is relevant--HTML doesn't require a BOM, nor does it
cause any problems if one exists.
#2, OTOH, is critical. If you aren't specifying UTF8 encoding, you will
not get the right results.
I agree with some other posters in the thread--use [myString
UTF8String] and output that. It seems as if the NSString writeToFile
method does not give you enough control over encodings.
_______________________________________________
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