Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xkbcli how-to-type: Enhance arguments parsing & doc #505

Merged
merged 2 commits into from
Sep 23, 2024

Commits on Sep 23, 2024

  1. Add UTF-8 to UTF-32 decoding

    Add internal functions to convert UTF-32 to UTF-8, with corresponding
    tests.
    wismill committed Sep 23, 2024
    Configuration menu
    Copy the full SHA
    c1e2cc2 View commit details
    Browse the repository at this point in the history
  2. xkbcli how-to-type: Enhance arguments parsing & doc

    Currently the positional parameter of the CLI is either a Unicode code
    point or a keysym. However their respective format is not documented.
    
    It turns out that there are multiple issues due to the use of `strtol`:
    - Code points can be parsed as octal, decimal and hexadecimal, while
      keysyms can only be parsed as hexadecimal. Some programs outputs
      keysyms in their decimal form (e.g. `wev`) so it is worth to bring
      symmetry with code points.
    - Octal format is unusual for both and is triggered by leading zeros,
      which is unintuitive in this context.
    - `U+NNNN` format is the standard format for Unicode code points but is
      not supported.
    - Plain characters are not supported, e.g.: a, é, ß, Æ, γ, 🦆, etc.
      Although this is probably the easiest format for most users.
    
    Fixed the issues above:
    - Allow the code point to be passed exactly in the following formats:
      - Literal character (requires UTF-8 character encoding of the terminal);
      - Decimal number;
      - Hexadecimal number: either `0xNNNN` or `U+NNNN` (any digit count)
    - Allow the keysym to be passed exactly in the following formats:
      - Decimal number;
      - Hexadecimal number: `0xNNNN` (any digit count);
      - Name.
    - Improve both `--help` message and manual page.
    wismill committed Sep 23, 2024
    Configuration menu
    Copy the full SHA
    423b7c5 View commit details
    Browse the repository at this point in the history