[PATCH xinput] use ASCII art when UTF-8 environment is not available

Mark Kettenis mark.kettenis at xs4all.nl
Wed Dec 8 14:09:30 PST 2010


> Date: Wed, 8 Dec 2010 22:31:37 +0100
> From: Matthieu Herrb <matthieu.herrb at laas.fr>
> 
> +    /*
> +     * There is no standard way to detect UTF-8 capabilities of a
> +     * given terminal, but this gets pretty close as a good heuristic.
> +     */

Actually, there is a somewhat better way to do this.  GCC does
something like this:

      const char *encoding;

      encoding = nl_langinfo(CODESET);
      if (encoding != NULL
          && (!strcasecmp(encoding, "utf-8")
              || !strcasecmp(encoding, "utf8")))
        {

If you ask me, this is all a bi silly though.  I think xinput should
simply only use ASCII.


More information about the xorg-devel mailing list