Can someone please shed some light on this sick sorcery:
System.out.println(("a".equals("a"))); //true
System.out.println(("a".equals("а"))); //false
System.out.println(("Joachim Garraud" == "Joachim Garraud")); //true
System.out.println(("Joachim Garraud" == "Joаchim Garraud")); //false
System.out.println(("Joachim Garraud".equals("Joаchim Garraud"))); //false
System.out.println(("Joachim Garraud".equals("Joachim Garraud"))); //true
I have no idea what is going on here, but I swear I get these results. I really don't see any difference, and the results are consistent - also when I copy a "false-line", I get false again and vice versa.
I suspect that the cause is that your code contains different versions of (for instance) the "a" character. For instance, a lower-case LATIN A could look identical to a lower-case CYRILIC A ... but they are different Unicode code points (\u0061 versus \u0430), and therefore not equal.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With