If I run the code in Eclipse / Windows, I get different results than if I run the code in Android.
After importing the jar library into Android project, the Collator is giving me different results for dash and forward slash characters.
I was expecting similar behavior.
Can somebody explain this?
package java.text;
Collator myCollator = Collator.getInstance(Locale.US);
Result:
myCollator.compare(" ", "-")
In Windows: -1 In Android: 1
myCollator.compare("/", ".")
In Windows: -1 In Android: 1
The Windows results seem to be correctly sorted according to this table here:
But the results in Android are not.
Apparently, there are differences in the collator for the Android environment and Windows Java SDK.