title: Two strings are not equal
body: <p>I have a Question class with some properties including location name, which is String. I also have a Location class which has some properties and a name method. I want to check if the two are equal, here are some methods and the result:</p>
  
  <pre><code>Log.e("", question.getLocation() + ", size:" + question.getLocation().length());
  Log.e("", mLocation.getLocationName() + ", size:" + mLocation.getLocationName().length());
  Log.e("", "equals: " + question.getLocation().equalsIgnoreCase(mLocation.getLocationName()));
  Log.e("", "location equals self: " + mLocation.getLocationName().equalsIgnoreCase(mLocation.getLocationName()));
  Log.e("", "question location equals self: " + question.getLocation().equalsIgnoreCase(question.getLocation()));
  </code></pre>
  
  <p>and here is the log:</p>
  
  <pre><code>10-10 19:11:35.618    1893-1893/com.example E/﹕ Machine Room, size:12
  10-10 19:11:35.618    1893-1893/com.example E/﹕ Machine Room, size:12
  10-10 19:11:35.618    1893-1893/com.example E/﹕ equals: false
  10-10 19:11:35.618    1893-1893/com.example E/﹕ location equals self: true
  10-10 19:11:35.618    1893-1893/com.example E/﹕ question location equals self: true
  </code></pre>
  
  <p>I have no idea what is happening and why two strings are not equal? Can anyone tell me?</p>
  
  <pre><code>public class Question {
     ...
     private String location;
  
     public String getLocation() {
      return location;
     }
  
     public void setLocation(String location) {
      this.location = location;
     }
  
  }
  
  public class Location {
     ...
     private String locationName;
  
     public String getLocationName() {
       return locationName;
     }
  
     public void setLocationName(String ln) {
       locationName = ln;
     }
  }
  </code></pre>
  
  <p>They have only getters and setters, and they are not modified anywhere else so nothing touches the two words between the logs.</p>
  
  <p><b>SOLUTION</b> </p>
  
  <p>As RC mentioned in the comments:
  dump both string as bytes and compare, perhaps the space is not a space on one of the string (alt+0160 produce a space "look-alike" under MSWindows)</p>