Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

URLyBird's [Version 1.2.3]

 
Payal Shah
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"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."

1)Can Someone please explain the above?
2)What does "null terminated" mean?
3) 8 bit char ..how?? [i.e. location is 64 byte..how can it be 8 bit]??

Thank you
 
Alecsandru Cocarla
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
2) maybe you should read a little bit about C strings
3) did you try google/wikipedia on US ASCII character encoding?
 
mohamed sulibi
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi;

- 8 bit char mean the available bits to store one char is 8-bit, The character encoding is 8 bit US ASCII==> mean just the chars that is in the ASCII so there are no arabic or another language just english,
- null terminated ==> if the field have the value "mohamed" in the location so the the field in the db will be "mohamed " and the empty string is null or '\0' or the byte "00000000" is an null char. so in the above ex there are 64- len("mohamed") = 57 null bytes after mohamed.

regards.
 
Roberto Perillo
Bartender
Posts: 2271
3
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Even if you had searched at Google about the 8 bit US-ASCII encoding, you would still have doubts about it, as it is a 7 bit character encoding, not 8. It means that you have to read/right records from the databae using this character encoding. For instance, when I read records from the database, I create Strings with each byte array that corresponds to one field value, using this encoding (new String(byte array, "US-ASCII")). You may still use it, even though it is a 7 bit character encoding. I justified that I used it anyway, even though the specifications refer to it wrongly.

About the null terminators, I did not use them. I added extra spaces to the value of each field, so it has the maximum size of its position. For instance, a field can have 64 characters, and the value has 30, so the value that will be persisted is 30 + 34 blank spaces.

Payal, please feel free to come here and ask any question you want. Someone will indeed help you!
 
Payal Shah
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To All,

Thank you so much for your reply with good examples. It helped a lot to make it clear.

Regards,
Payal
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic