• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

the deprecation method

 
mao lao
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
for the deprecated method
use new String(buffer, offset, length)
or new String(buffer, offset, length, enc)?
I used the first one, is that ok?
any comments?
[ November 26, 2002: Message edited by: mao lao ]
 
Stephane Weber
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes that's ok. It will use your platform's default charset.
I also did it that way.
Stephane
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Of course you will need to argue why that is the right choice. And that is part of a broader issue -- how do you handle encodings? What encodings do you support? Does it matter anyway?
- Peter
 
mao lao
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks I see now,
I was just not so confident
 
Detlev Beutner
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, but I think you will have to use a CharSet. The database given is US-ASCII, so running your program on an OS/390 with the database given (and a platform default CharSet of EBCDIC) but without an encoding Charset will show up senseless entries...
Hope it helps
Detlev
 
Jens Olsen
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I looked at the constructors, saw readUTF and rewrote the method to use that and avoid the byte[] stuff.
 
mao lao
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes the constructor has
db.writeUTF(fields[i].getName());
the api says:
Writes a string to the file using UTF-8 encoding in a machine-independent manner;
so I think should use "UTF-8"
 
Jeff Song
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
so use the new String(buffer, offset, description[i].getLength(), "UTF-8")
???
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic