• Post Reply Bookmark Topic Watch Topic
  • New Topic

character encoding error  RSS feed

 
Abigail Decan
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


for this program, i successfully did create an output.txt, but i have some weird characters in front of "hello" when i open it in notepad or wordpad.
this is probably because i'm using a japanese computer.
how can i fix this?
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ObjectOutputStream does not do what you think it does (read its javadocs for more details on what it does). If you want a plain text file, use the BufferedOutputStream directly (or wrap a BufferedWriter around a FileWriter).
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!