Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

null terminated text fields?

 
Henry Zheng
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm currently working with my assignment, and I got a problem regarding to the format of the text fields in the db file.

My assignment mandates all text fields be "null terminated if less than the maximum length for the field"(directly quoted from instructions).

But when I checked the original db file comes along with the assignment, I found that text fields are padded by spaces.

So should I pad the empty bytes with 0 or with white spaces? And do I need to consider the whitespace padding in the original records part of the fields(which is not sensible) or just rip them off?

Thanks!
 
Omar Kalaldeh
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Henry,

I think the following link will help you,
URLyBird 1.3.3 data file: Reply from SUN

Padding strings with white spaces is completely accepted by sun, and it is the easiest way.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic