Re: Text file
Re: Text file
- Subject: Re: Text file
- From: Henrietta Read <email@hidden>
- Date: Mon, 19 Apr 2010 13:48:19 -0700
That's a good idea, thank you! :)
On Sun, Apr 18, 2010 at 12:41 PM, Jens Alfke <email@hidden> wrote:
>
> On Apr 18, 2010, at 12:40 AM, Henrietta Read wrote:
>
> > exactly the point germane, but in perusing NSString.h one is given to
> understand this method might not be as 'smart' as one could wish:
>
> I wouldn’t think it would fail with MacRoman, though. Did you check the
> output NSError? Also, try inspecting the file with a hex editor … maybe
> there are some invisible null bytes or control characters.
>
> What I usually do in cases like this, when trying to decode arbitrary data
> to strings, is to fall back to assuming NSWindowsCP1252StringEncoding. This
> is (a) a very common encoding [the default on most Windows systems], (b)
> fairly standard (it’s a superset of ISO-Latin-1), and (c) always works since
> it encodes all 256 bytes values.
>
> —Jens
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden