I want to do this: How can I replace non-printable Unicode characters in Java?
But instead of replacing non-printable characters with a ? or a blank, I want to replace with the (Unicode) codepoint. I'm trying to compare strings. If the comparison fails, the error message must show me the difference, so I can't lose detail by making them all "?"
assertEquals(expected.replaceAll("\\p{C}", "?"), fb.toString().replaceAll("\\p{C}", "?"));