0

I include the following method in my code to help with lowercase letters, extra spaces etc... But I seem to get the same wrong message. Can you please explain what it mean? I've never seen it before so would really appreciate some help.

Thanks!

"Found characters that are probably not UTF-8 encoded the following places: DogRegister.java:73: "" (Unicode: 2019) This test is not perfect. At the moment, it relies on a "whitelist" with all the characters directly visible on a common Swedish keyboard. If you use other characters, or some accent combinations, the test will fail even if the code is in UTF-8. Also note that some characters are available in several variants that can be difficult to distinguish from each other. If you find that the character / characters above look okay, google the unicode code so you can see what character it really is."

private String readCommand() {
return input.nextLine().trim().toLowerCase();
}
private String readString(String message) {
System.out.print(message);
String input = readCommand();

while (input.isEmpty()) {
System.out.println("Error! the name can’t be empty");
System.out.print(message);
input = readCommand();
}
return input;
crispycat
  • 79
  • 3
  • 8
  • Which line is 73? – Mad Physicist Jan 15 '19 at 17:18
  • Is that that "test" (which "This test is not perfect" refers to) applied to your source code? If so do you use any plugin? Normally the compiler shouldn't even know that it is dealing with Swedish text. If it is applied to other text, could you provide more information on what you use and how, preferably a [mcve]? – Thomas Jan 15 '19 at 17:20
  • Is that a [***smart quote***](https://support.office.com/en-us/article/smart-quotes-in-word-702fc92e-b723-4e3d-b2cc-71dedaf2f343) in `can’t`? Did you copy that from Word? – Elliott Frisch Jan 15 '19 at 17:21
  • `"Error! the name can’t be empty"` ? Check your IDE uses UTF-8 and not system character set like `CP-1252` aka `Windows-1252` or `ISO 8859-10` or whatever it is. [Eclipse](https://stackoverflow.com/questions/3751791/how-to-change-default-text-file-encoding-in-eclipse), [IDEA](https://blog.jetbrains.com/idea/2013/03/use-the-utf-8-luke-file-encodings-in-intellij-idea/) – Victor Gubin Jan 15 '19 at 17:26

0 Answers0