Verifying the ability of CPAINT to handle arbitrary charsets. The data being put in the backend is converted to UTF-8, where non-printable characters are additionally converted to the sequence \u00xy which is the standard JavaScript representation.

NOTE: The conversion to UTF-8 is performed only if the iconv extension of PHP is available or if the input characterset is ISO-8859-1, which can be converted by other means. If both is not the case the characters are cleaned up to form valid XML and are sent as-is. This should still work.
Without this extra conversion most browsers' XML parsers will crash.

CPAINT frontend decodes the character stream before handing it to the callback function.

single-byte charactersets:
standard 7bit ASCII
non printable characters
common but problematic characters
german
swedish
arabic
russian
greek
hebrew

multi-byte charactersets:
japanese (EUC-JP)
chinese (Big5)