Improve CharSet testing bug 22095, from Phil Steitz Rewrite CharSet parsing, much neater and simpler now