FROM : Tim Gogolin
DATE : Tue Apr 19 20:31:08 2005
Have you tried turning the NSString into an NSData (encoded as UTF8)
and then writing the NSData out to the file?
-- Tim Gogolin
On Apr 19, 2005, at 12:53 PM, 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?
>
> Thanks!
>
> August
>
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Cocoa-dev mailing list (<email_removed>)
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/<email_removed>
>
> This email sent to <email_removed>
DATE : Tue Apr 19 20:31:08 2005
Have you tried turning the NSString into an NSData (encoded as UTF8)
and then writing the NSData out to the file?
-- Tim Gogolin
On Apr 19, 2005, at 12:53 PM, 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?
>
> Thanks!
>
> August
>
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Cocoa-dev mailing list (<email_removed>)
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/<email_removed>
>
> This email sent to <email_removed>
| Related mails | Author | Date |
|---|---|---|
| August Trometer | Apr 19, 19:53 | |
| Ondra Cada | Apr 19, 20:23 | |
| Jim Hamilton | Apr 19, 20:26 | |
| Douglas Davidson | Apr 19, 20:26 | |
| Shawn Erickson | Apr 19, 20:30 | |
| Tim Gogolin | Apr 19, 20:31 | |
| Shawn Erickson | Apr 19, 20:35 | |
| Sherm Pendley | Apr 19, 20:39 | |
| John Stiles | Apr 19, 20:44 | |
| August Trometer | Apr 19, 20:57 | |
| Ondra Cada | Apr 19, 21:18 |






Cocoa mail archive

