zephyr-im/zephyr — pull request #132 by andersk (2014-05-15 04:41:20+00:00)
Title: zwrite: Assume UTF-8 rather than ISO-8859-1 in an ASCII locale

It turns out that lots of scripts still run `zwrite` without setting any locale environment variables. The charset of the default C locale is ANSI_X3.4-1968 (ASCII), so we were sending `z_charset = ZCHARSET_ISO_8859_1`. But UTF-8 is much more common these days, so this results in a lot of mislabeled zephyrs.

Other clients just ignore `z_charset` (Roost made a good-faith effort to respect it, and gave up after finding that it really has no correlation with the actual charset); but it still caused incorrect display in `zwgc`.

Since UTF-8 is just as good a superset of ASCII as ISO-8859-1 is, we should just assume UTF-8 by default in this case.

(We still assume ISO-8859-1 if the locale explicitly specifies that, such as en_US. Almost nobody uses such locales anymore.)