Re: NSString looses Umlaute
Re: NSString looses Umlaute
- Subject: Re: NSString looses Umlaute
- From: Ken Thomases <email@hidden>
- Date: Thu, 22 Dec 2011 10:29:05 -0600
On Dec 22, 2011, at 9:54 AM, Alexander Reichstadt wrote:
> The DBF file format documentation says the header is in binary, then there is a linefeed (\r), then there is the body. Each field has a fixed length, wether used or not doesn't matter, the unused rest is filled with spaces.
>
> So, I read the file as data, stringily it as DOSLatin1, split it at the linefeed and read the body according to the field definitions I am given. They are guaranteed, so maybe some day I get around to writing a nice DBF parser, but until then I go by the guaranteed field lengths.
>
> I tested it now on a couple of files and it works without a hitch.
If the header is binary, then any of its bytes might be 0x0D, which is the same as \r (or did you actually mean it when you said "linefeed" which is 0x0A or \n?), so your approach will fail. In all probability, the header is a fixed length and you can just skip that part of the data. Either way, if this is meant for more than a casual, one-off, in-house app, you'll have to find a more reliable technique.
Regards,
Ken
_______________________________________________
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