Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-27137

command line client : using emoji breaks formatting, due to incorrectly calculated char width

    XMLWordPrintable

    Details

      Description

      table is incorrectly formatted, if emoji is used .utf8mb4 is used on client. This is not specific to Windows, it is about numcells charset method, which should be returning 2 (as it takes the same width as Chinese in the example, i.e , double width of a narrow character in monospace font). The "width" of a character is defined in https://unicode.org/Public/UCD/latest/ucd/EastAsianWidth.txt (the name is largely historical, since this file existed back in Unicode 2.0 already, long time before emoji). For example following line is included

      1F600..1F64F;W   # So    [80] GRINNING FACE..PERSON WITH FOLDED HANDS
      

      I used 1F600 in the attached example.

      Currently, my_numcells_mb() only handles CJK Ideograph Extension B, C , outside of BMP. but nothing in emoji range

        Attachments

          Activity

            People

            Assignee:
            bar Alexander Barkov
            Reporter:
            wlad Vladislav Vaintroub
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:

                Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.