• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

NX (Contractors): Encoding instructions unclear?

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Everyone,
When describing the data format, the instructions state:

All text values, and all fields (which are text only), contain only 8 bit characters, null terminated if less than the maximum length for the field. The character encoding is 8 bit US ASCII.


US ASCII is a 7-bit encoding. Should I be using ISO 8859 instead?
Also, when I do a hexdump of the db file I get the following:

It shows that fields are space terminated (0x20) and not null terminated (0x00). I assume that the instructions are using "null terminated" loosely, but I just want to make sure I am not overlooking something critical. How did you all interpret this?
 
David Lindquist
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Whoops, sorry folks. I should have done a search on this topic before I posted. I just found a plethora of previous posts discussing this.
 
Ranch Hand
Posts: 555
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
There is a standard encoding "US-ASCII", which is supported by standard jdk.

It shows that fields are space terminated (0x20) and not null terminated (0x00). I assume that the instructions are using "null terminated" loosely, but I just want to make sure I am not overlooking something critical. How did you all interpret this?


Take a look at the thread in the past.
There several solutions:
Some people have just ignored issue with null-terminated string, some did it, since it is still valid operation to save a record containing space charachters (e.g. client sends update request isntead of "abc" , "abc ".
I save records filled with blanks on the rest, but if built in a parser for read in case an other programm writes null-terminated string in the data file.
Vlad
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic