-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
console.table appears to have padding issues when ¥ (FULLWIDTH YEN SIGN) is involved #29299
Labels
console
Issues and PRs related to the console subsystem.
Comments
cc @srl295 is there any way to fix this besides a specific override for this character? |
addaleax
added a commit
to addaleax/node
that referenced
this issue
Aug 24, 2019
This is more accurate for displayed full-width characters (e.g. CJK ones) and makes the calculations match the ones we use in the readline module. Fixes: nodejs#29299
3 tasks
#29300 should work for this, it’s the solution we use for readline/the REPL. |
BridgeAR
pushed a commit
that referenced
this issue
Sep 3, 2019
This is more accurate for displayed full-width characters (e.g. CJK ones) and makes the calculations match the ones we use in the readline module. Fixes: #29299 PR-URL: #29300 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
BridgeAR
pushed a commit
that referenced
this issue
Sep 4, 2019
This is more accurate for displayed full-width characters (e.g. CJK ones) and makes the calculations match the ones we use in the readline module. Fixes: #29299 PR-URL: #29300 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
v10.16.2
(using nvm I can reproduce withv12.9.0
too)Linux stormo 5.2.9-arch1-1-ARCH #1 SMP PREEMPT Fri Aug 16 11:29:43 UTC 2019 x86_64 GNU/Linux
I've been comparing differences between currency formattings for different locales, when I stumbled across a minor irregularity in the output of
console.table
.Consider the following example code:
The resulting console output on my machine appears like this:
From what I can gather so far:
¥
in a string is sufficient to provoke the behavior given that it is theFULLWIDTH YEN SIGN
(U+FFE5) and not theYEN SIGN
(U+00A5).abc…xyz
in a different row doesn't change the outcome.To me this hints that the length for the specific strings with
¥
in it could be calculated to be shorter than it actually is.For completeness here's a screenshot of the original output I encountered:
After realizing that there are also rather short entries in my original output, I've created this additional test case:
The corresponding output looks like this:
It appears that the problem here lies with charCode
65509
rather than with165
.So I'm concerned about the FULLWIDTH YEN SIGN at code point
U+FFE5
rather than the YEN SIGN at code pointU+00A5
.I've had a look at #27915 before and am under the impression that this is the right channel for this kind of issue. Please feel free to educate me otherwise ;)
The text was updated successfully, but these errors were encountered: