Is there a utility, preferably open source and written in C, that inspects UTF-16/UTF-16BE/UTF-16LE text and identifies broken surrogate pairs and illegal characters? Ideally, the utility can both report illegal code units and "repair" them by replacing them with U+FFFD.
Jim Monty

