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

Unicode can mess up alignment even with wcwidth and WIDE_CHARS_MODE on #108

Closed
DragonRulerX opened this issue Jan 21, 2021 · 7 comments
Closed

Comments

@DragonRulerX
Copy link

DragonRulerX commented Jan 21, 2021

I've found an issue with representing certain Unicode symbols in tabulate and I'm not sure if this is already known given the other two issues seemingly pointing out a similar issue, but not using emoji's in their claims:
#52
#28

I'm pretty new to using GitHub so please excuse the use of pictures instead of the raw data.
I couldn't figure out how to format it so that it wouldn't remove the white space which is the primary point of concern.

Editor Sublime Text3:
Image shows logged table in text file
image

Discord:
Image shows code blocked table
image

PowerShell:
Image shows logged table in PowerShell (just as reference since my terminal is not Unicode aware, but then things line up)
image

This is the raw data:
usersid | name | active
-----------+---------------+----------
26 | ❆ 𝕀𝕧𝕒 🎀 ℕ𝕒 ❆ | True
34 | 𝓢𝓮𝓽𝓱🌹 | True
32 | 𝓓𝓪𝓻𝓴 𝓔𝓯𝓯𝓮𝓬𝓽𝔃 | True
1 | Dragon | True

@cmccandless
Copy link

Bump. Can confirm this issue in 0.8.7

@astanin
Copy link
Owner

astanin commented Feb 17, 2021

This issue has been fixed in the current master branch.
See also: pull request #58.

image

@astanin astanin closed this as completed Feb 17, 2021
@DragonRulerX
Copy link
Author

I'm not convinced this was fixed. I just pulled 0.8.9 and tried it and my results were still like my original post. I'm not sure if this is a terminal/editor issue or not, but ultimately Discord still doesn't render it properly, but PowerShell does.

@joscha
Copy link

joscha commented Jun 7, 2021

I am hitting this issue with the latest version with emojis, specifically 🪦, 👑 and ✅ .

@Jeiwan
Copy link

Jeiwan commented Nov 29, 2021

To have this fixed you need to install widechars:
https://github.com/astanin/python-tabulate#wide-fullwidth-cjk-symbols

@azumukupoe
Copy link

Emoji modifiers still cause misalignment

+------+---------------------------------+------------------+
| S.NO |              Name               |      Owner       |
+------+---------------------------------+------------------+
|  1   |               👨‍💻                |       S B        |
|  2   |               👨‍💻                |       saku       |
|  3   |               👨‍💻                |      Pranav      |
|  4   |    música para programar 👨‍💻     |     midudev      |
|  5   |            👨‍💻📖🎸❤️             |  waterfall7529   |
|  6   |              👨‍🎓👨‍💻               |    Riko Akami    |
|  7   |             👷‍♂️👨‍💻👨‍💼              |       naru       |
|  8   | テレワーク BGM👨‍💻Boom Bap / Jazz | CHELSEA  Records |
|  9   |             🔥👨‍💻🏋️‍♀️              |   shoma ishida   |
|  10  |            📚📖✍️👨‍💻             |       REN        |
+------+---------------------------------+------------------+

image

@hoishing
Copy link

hoishing commented Sep 4, 2024

I got the same emoji problem, maybe its related to the terminal font also, I use Sarasa Mono TC font as a work around

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants