I am trying to create a language model which processes words and I am having problems as my corpus is in a foreign language and therefore has unicode characters such as ġ,ħ and ż but the .equals is not working on words with these letters even though I'm reading text from a text file and copying such words exactly. What can I do to fix this?
public class test3 {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
String line;
System.out.print("Enter string: ");
line = s.nextLine();
if(line.equals("aħħar")){
System.out.println("Correct");
} else {
System.out.println("Incorrect");
}
}
}
I have entered the word 'aħħar' and keep getting "Incorrect".