When I try to write illegal characters to a PDF I obviously get an exception. E.g.
contentStream.showText("some illegal characters");
...
java.lang.IllegalArgumentException: U+000A ('controlLF') is not available in this font Helvetica (generic: ArialMT) encoding: WinAnsiEncoding...
How can I find out which characters are not supported and strip them from the string?