Quite rare to see me post in the Java forum but have been picking it up as part of a long-distance university course I am doing.
I am currently trying to read in an ASCII coded .txt file and output it but am seeing some funny characters showing up.
The content is loaded using
BufferedReader inputReader;
System.out.println("Loading book...");
try {
inputReader = new BufferedReader(new InputStreamReader(new FileInputStream(fileToRead), "ASCII"));
Which I then split on the new page character into book "pages".
When I come to print these out to console using
try {
PrintStream output = new PrintStream(System.out, true, "ASCII");
for (String theWord : words) {
output.println(theWord);
}
}
This: Sorrow came—a gentle sorrow—but not at all in the shape of any disagreeable
Comes as: Sorrow came???a gentle sorrow???but not at all in the shape of any disagreeable
NOTE: The dash is an em-dash