regex results differences in same check
Hi I have a some that is running differently on two servers.
I am trying to replace the charater that represents a non-breaking
space with &160; the HTML equivalent.
The following code gives two diffrent results:
java.util.regex.Pattern pattern =
java.util.regex.Pattern.compile("\\u00C2\\u00A0");
if (pattern.matcher(str).find()) {
System.out.println("found a space");
} else { System.out.println("did not find a space");
}
pattern = java.util.regex.Pattern.compile("\\u00C2");
if (pattern.matcher(str).find()) {
System.out.println("found 302");
} else { System.out.println("did not find 302");
}
pattern = java.util.regex.Pattern.compile("\\u00A0");
if (pattern.matcher(str).find()) {
System.out.println("found 240");
} else { System.out.println("did not find 240");
}
On one server I get:
did not find a space
did not find 302
found 240
On the Other I get:
found a space
found 302
found 240
Both servers are running redhat 8.0 and have the same jdk.
Does anyone know what setting on the system could cause this?
thanks.

