Changeset b79c91cc in mainline


Ignore:
Timestamp:
2021-09-01T07:30:41Z (3 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
45004f3
Parents:
81ec7e1
git-author:
Jiri Svoboda <jiri@…> (2021-08-31 18:30:17)
git-committer:
Jiri Svoboda <jiri@…> (2021-09-01 07:30:41)
Message:

Enable UTF-8 on user-space serial console output

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/output/port/chardev.c

    r81ec7e1 rb79c91cc  
    7878}
    7979
    80 static void chardev_putuchar(char32_t ch)
     80static void chardev_putchar(char ch)
    8181{
    8282        if (chardev_bused == chardev_buf_size)
    8383                chardev_flush();
    84         if (!ascii_check(ch))
    85                 ch = '?';
    8684        chardev_buf[chardev_bused++] = (uint8_t) ch;
     85}
     86
     87static void chardev_putuchar(char32_t ch)
     88{
     89        char buf[STR_BOUNDS(1)];
     90        size_t off;
     91        size_t i;
     92        errno_t rc;
     93
     94        off = 0;
     95        rc = chr_encode(ch, buf, &off, sizeof(buf));
     96        if (rc != EOK)
     97                return;
     98
     99        for (i = 0; i < off; i++)
     100                chardev_putchar(buf[i]);
    87101}
    88102
Note: See TracChangeset for help on using the changeset viewer.