• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

'\u0000' at the end of some fields

 
emil dragan
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The unused bytes in some fields (e.g. Carrier, Price, etc.) are set to '\u0000' and are displayed as squares in my table. I have a routine in the my TableModel that strips away the unused bytes, but there's got to be a better way to do that. I've tried different encodings inside my readRecord() routine (Data.java) with no results. Does anyone know of a better way to do this?
[This message has been edited by emil dragan (edited December 29, 2001).]
 
Rene Larsen
Ranch Hand
Posts: 1179
Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Emil
You should just use the <code>trim()</code> method in your <code>readRecord()</code>
e.g. <code>new String(...,...,...,...).trim();</code>
/ Ren´┐Ż
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic