Comparing utf-8 strings in java
- by cppdev
Hi,
In my java program, I am retrieving some data from xml. This xml has few international characters and is encoded in utf8. Now I read this xml using xml parser. Once I retrieve a particular international string from xml parser, I need to compare it with set of predefined strings. Problem is when i use string.equals on internatinal string comparison fails.
How to compare strings with internatinal strins in java ?
Here's the line that compares strings
string country;
if(country.equals("Côte d'Ivoire"))
{
}