Fix counting and output of long Unicode characters

Addresses #216 by encoding into UTF-32 before calculating common prefix,
then decoding back to Unicode for output through the OS layer.
Merge branch 'long-unicode' into case_modes