Previously running a file load in Netbeans and grabbing the String entries for comparison produced predictable results:
(Over-simpliflied to get to the heart of the problem.) File 1: UTF-8 Encoded File 2: ISO-8859-1 Encoded
NETBEANS
String strFromFile1 = "A - B";
String strFromFile2 = "A - B";
(strFromFile1 == strFromFile2) evaluated to true.
However, after moving the project to Eclipse, I noticed sometimes the strings value would change, and only for one of my many files, sometimes stripping out the dash (-), with no discernible pattern:
ECLIPSE
String strFromFile1 = "A B";
String strFromFile2 = "A - B";
(strFromFile1 == strFromFile2) evaluated to false.
The comparison is correct, but why did the first string change? The source text files did not change. They both contained the dash. However, the character encoding of each file was different.
Why did this happen? Why is Eclipse choosing to ignore certain characters from a specific file? Other files of the same encoding types (ISO-8859-1, UTF-8) did not experience this issue.