• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

hexeditor: how to put in "20"? what is "20"?

 
josine wilms
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

When I save new records in the database file, I apparently filled after the hotelname or city name squares instead of spaces.

When I look with a hexeditor, sun saved the records with "20"'s as a space fill up, and I do with "00"'s.

I tried saving with ISO-8859-1, the subset US-ASCII and UTF-8, but it keeps saving with all "00"'s in my file.

How can I also fill it with "20"'s ?

I'm rather confused.
Josine

:roll:
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The '20' you are seeing is a hexadecimal number. It's value in decimal is 32 (2 times 16 plus 0). That's the ASCII code for a blank character. The 'squares' you get after writing your record are the console's (or some other visual output device's) way of showing an unprintable character. 00 ('NUL') is unprintable and that is what you are probably seeing as a square. So instead of filling your field with 0 use 32, ' ', or 0x20.

Hope that gets you on the road again.
[ December 29, 2006: Message edited by: Barry Gaunt ]
 
josine wilms
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Barry,

Thanks for your answer. I found a solution that worked. I am using a StringBuilder for building the record, which apparently got me the squares when initializing it. I'm now initializing it with " ". It's working.



Almost finished now
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic