Uh oh!
There was an error while loading. Please reload this page.
util: improve unicode support - #31319
Conversation
81735c6 to
02515e8Compare
This comment has been minimized.
This comment has been minimized.
02515e8 to
80fe23bCompare
This comment has been minimized.
This comment has been minimized.
da70f98 to
fc7f090CompareTrott
commented
Jan 13, 2020
I'm not sure who to ping for a review. @srl295 maybe? |
srl295
left a comment
There was a problem hiding this comment.
LGTM. Could optimize the existing code, but generally LGTM.
There was a problem hiding this comment.
So this might be doable as a regex… it could be compiled as a regex, i don't think there's an East Asian Width property available in regex.
There was a problem hiding this comment.
This could definitely be a regular expression. I guess it's slower that way but I did not check. I'll have a look soon.
There was a problem hiding this comment.
ICU4C also has API to get the East Asian Width.
There was a problem hiding this comment.
Yes, we use that in case Node.js is build with ICU but this is the fallback code.
The array grouping function relies on the width of the characters. It was not calculated correct so far, since it used the string length instead. This improves the unicode output by calculating the mono-spaced font width (other fonts might differ).
fc7f090 to
1b9547fComparenodejs-github-bot
commented
Jan 17, 2020
Trott
commented
Jan 18, 2020
Relevant test failures in the no-intl host on CI? |
nodejs-github-bot
commented
Jan 20, 2020
The array grouping function relies on the width of the characters. It was not calculated correct so far, since it used the string length instead. This improves the unicode output by calculating the mono-spaced font width (other fonts might differ). PR-URL: #31319 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Steven R Loomis <srloomis@us.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
BridgeAR
commented
Jan 22, 2020
Landed in 8fb5fe2 🎉 |
The array grouping function relies on the width of the characters. It was not calculated correct so far, since it used the string length instead. This improves the unicode output by calculating the mono-spaced font width (other fonts might differ). PR-URL: #31319 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Steven R Loomis <srloomis@us.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
codebytere
commented
Mar 15, 2020
@BridgeAR if this should go back to |
The array grouping function relies on the width of the characters. It was not calculated correct so far, since it used the string length instead. This improves the unicode output by calculating the mono-spaced font width (other fonts might differ). PR-URL: nodejs#31319 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Steven R Loomis <srloomis@us.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
The array grouping function relies on the width of the characters. It was not calculated correct so far, since it used the string length instead. This improves the unicode output by calculating the mono-spaced font width (other fonts might differ). PR-URL: #31319 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Steven R Loomis <srloomis@us.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
The array grouping function relies on the width of the characters.
It was not calculated correct so far, since it used the string
length instead.
This improves the unicode output by calculating the mono-spaced
font width (other fonts might differ).
I had to move some functions. Otherwise we'd have to load the utils functions by default and that did not seem necessary.
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes