After I upgraded to Java 17 using the Microsoft OpenJDK, all the tests that use non-ASCII characters are failing due to encoding failure issues.
For instance, one of my tests uses the following Unicode characters (e.g., U+2660 to U+2663):
entityManager.persist(
new Suit()
.setName("Club")
.setSymbol("♣")
);
entityManager.persist(
new Suit()
.setName("Diamond")
.setSymbol("♦")
);
entityManager.persist(
new Suit()
.setName("Heart")
.setSymbol("♥")
);
entityManager.persist(
new Suit()
.setName("Spade")
.setSymbol("♠")
);
How to fix it?