aspose file tools*
The moose likes I/O and Streams and the fly likes unwanted chars Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "unwanted chars" Watch "unwanted chars" New topic
Author

unwanted chars

feroz muhamed
Ranch Hand

Joined: Nov 15, 2003
Posts: 87
hi when i am writing data(input via keyboard using readLine method) to file using FileWriter,some unknowncharacters like 000 etc were seen what is this how can i avoid it? please help thanx in advnc
Adrian Yan
Ranch Hand

Joined: Oct 02, 2000
Posts: 688
Are you writing text file? If you are, use FileWriter.
Timmy Marks
Ranch Hand

Joined: Dec 01, 2003
Posts: 226
having the same problem while using FileWriter. When opening the file with notepad there are squares added into the file, but with (for example) wordpad they are gone.
Anyone have any idea where they come from? The text is taken from a JTextArea. The display there is also OK.
jason adam
Chicken Farmer ()
Ranch Hand

Joined: May 08, 2001
Posts: 1932
I notice the same thing when opening some .java files, depending on how the files were created (for example, in JBuilder or some other IDE).
I think it comes from Notepad being a very simple text editor. Wordpad is slightly "smarter", so it knows how to handle special characters and formatting better.
 
 
subject: unwanted chars
 
Similar Threads
Part II/III, what did you use to draw the diagrams?
Head First - MiniMiniMusicCmdLine
Getting "Lookup Error Name comp/env/mail not found in context "java:"." error
Replace Double Quote and Single Quotes
Alternate flows -- sequence diagrams