Skip to content

Wrong display of unicode chars with zero-width joiner (U+200D) #1861

@flashcode

Description

@flashcode

Bug summary

Unicode chars with zero-width joiner (U+200D) are displayed with wrong column count in chat area.

This is one remaining bug of issue #1857, which has been closed because it was a ncurses bug.

Steps to reproduce

  1. Compile WeeChat compiled against ncurses ≥ 6.3_p20220612
  2. Run WeeChat in a terminal able to display such Unicode char, like WezTerm or kitty (not to be confused with KiTTY which is a fork of PuTTY).
  3. Execute this command: /eval /print [${\U1F62E\u200D\U1F4A8}]

Current behavior

Output is:

image

Note the two spaces before the closing bracket: they should not be displayed.

Expected behavior

No spaces before the closing bracket, ie WeeChat knows that the char is displayed on 2 columns and not 4.

Suggested solutions

Count chars together to have a displayed size of 2 instead of 4.

Additional information

Be sure you're using ncurses ≥ 6.3_p20220612 because older versions have a broken display (see #1857).


  • WeeChat version: 3.7.1
  • OS, distribution and version: Alpine Linux 3.17
  • Terminal: kitty
  • Terminal multiplexer (screen/tmux/…/none): none

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugUnexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions