• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSString looses Umlaute
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSString looses Umlaute


  • Subject: Re: NSString looses Umlaute
  • From: Alexander Reichstadt <email@hidden>
  • Date: Thu, 22 Dec 2011 18:22:26 +0100

The header cannot be of a fixed length, as it contains the fields, their length and their types, which can vary. What it says there is:

n above is the last byte in the field descriptor array. The size of the array depends on the number of fields in the table file.

More on this here:
<http://dbase.com/KnowledgeBase/int/db7_file_fmt.htm>



Am 22.12.2011 um 17:29 schrieb Ken Thomases:

> 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

References: 
 >NSString looses Umlaute (From: Alexander Reichstadt <email@hidden>)
 >Re: NSString looses Umlaute (From: Ben Kennedy <email@hidden>)
 >Re: NSString looses Umlaute (From: Alexander Reichstadt <email@hidden>)
 >Re: NSString looses Umlaute (From: vincent habchi <email@hidden>)
 >Re: NSString looses Umlaute (From: Alexander Reichstadt <email@hidden>)
 >Re: NSString looses Umlaute (From: Vincent Habchi <email@hidden>)
 >Re: NSString looses Umlaute (From: Alexander Reichstadt <email@hidden>)
 >Re: NSString looses Umlaute (From: Jean-Daniel Dupas <email@hidden>)
 >Re: NSString looses Umlaute (From: Alexander Reichstadt <email@hidden>)
 >Re: NSString looses Umlaute (From: Mike Abdullah <email@hidden>)
 >Re: NSString looses Umlaute (From: Alexander Reichstadt <email@hidden>)
 >Re: NSString looses Umlaute (From: Ken Thomases <email@hidden>)

  • Prev by Date: Re: providesPresentationContextTransitionStyle busted?
  • Next by Date: Re: NSString looses Umlaute
  • Previous by thread: Re: NSString looses Umlaute
  • Next by thread: Re: NSString looses Umlaute
  • Index(es):
    • Date
    • Thread