Skip navigation.
 
mlRe: Saving UTF-8 as File
FROM : Ondra Cada
DATE : Tue Apr 19 20:23:02 2005

August,

On 19.4.2005, at 19:53, August Trometer wrote:

> I have a situation where I need to create some HTML on the fly and
> save it to a file, then turn around and have WebKit read the file
> using a file:// URL. (Why? NDA until the 29th.)
>
> If I give WebKit the straight string, it handles any UTF-8 characters
> just fine.
>
> However, when I save to a file (using NSString
> writeToFile:atomically), it doesn't save as UTF-8 and when the file is
> read I get all kinds of bogus characters.
>
> Can someone point me in the right direction to be able to save the
> HTML string as a UTF-8 encoded file?


Well... the first paragraph kind of suggests you are one of those lucky
people who have Tiger already. If so, just please check what the
documentation says of the writeToFile:atomically: method of NSString
:)))
---
Ondra Čada
OCSoftware:    <email_removed>              http://www.ocs.cz
private        <email_removed>            http://www.ocs.cz/oc

Related mailsAuthorDate
mlSaving UTF-8 as File August Trometer Apr 19, 19:53
mlRe: Saving UTF-8 as File Ondra Cada Apr 19, 20:23
mlRe: Saving UTF-8 as File Jim Hamilton Apr 19, 20:26
mlRe: Saving UTF-8 as File Douglas Davidson Apr 19, 20:26
mlRe: Saving UTF-8 as File Shawn Erickson Apr 19, 20:30
mlRe: Saving UTF-8 as File Tim Gogolin Apr 19, 20:31
mlRe: Saving UTF-8 as File Shawn Erickson Apr 19, 20:35
mlRe: Saving UTF-8 as File Sherm Pendley Apr 19, 20:39
mlRe: Saving UTF-8 as File John Stiles Apr 19, 20:44
mlRe: Saving UTF-8 as File August Trometer Apr 19, 20:57
mlRe: Saving UTF-8 as File Ondra Cada Apr 19, 21:18