openstenoproject/plover — pull request #217 by morinted (2014-11-05 20:05:37+00:00)
Title: 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.

It works because UTF-32 is fixed-width, so each character always takes 4 "lengths". That's why when we get common prefix, I divide then multiply by 4. That rounds the result to get you the right count. I've tested against the issues I mentioned in the issue.