I have a scanner class reading a file into a string. Any file with this character "®" causes it to fail. I'm new to Java, Is there a better way to read this file so that character would be excepted?
public void readFile(String fileName)
fileText = "";
Scanner file = new Scanner(new File(fileName));
String line = file.nextLine();
fileText += line +"\r"+"\n";
catch (Exception e)
Mention the encoding when you create the scanner.
Scanner file= new Scanner(new File(fileName), "utf-8");