You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using System.Globalization;using System.Text;vars="\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d\udc67*";vargraphemes= StringInfo.GetTextElementEnumerator(s);while(graphemes.MoveNext()){
Console.WriteLine("Grapheme:"+ graphemes.Current);varrunes= graphemes.Current.ToString().EnumerateRunes();foreach(var rune in runes){
Console.WriteLine($"\tRune [{rune}] is {rune.Value} (0x{rune.Value:x}) - {string.Join('\0', rune.ToString().Select(c =>$"\\u{(int)c:x}"))}");}}
Console.WriteLine("123456789|123456789|123456789|123456789|123456789|123456789|");
Console.WriteLine(s);
Expected Behavior
This code creates a string named s with one grapheme cluster (👩👩👧👧 and one asterisk). Iterates over both graphemes, printing its code points individually. When the code point U+200d is printed it occupies one column even thought is a 0-width code point.
That has the consequence that the grapheme is 11 columns wide (4 * 2+3) instead of 8 columns wide (4 * 2).
Here is a screenshot of the program running in WT:
As you can see, the * starts in column 12, and the individual U+200d printed have one column width.
Default Ubuntu terminal seems to handle this a little bit better: although the grapheme cluster is not shown as a single character but a sequence of its individual code points, the U+200d does not have any width, and the overall width of the grapheme is 8:
As you can see, the * starts in column 9 and the U+200d does not have any width
Actual Behavior
Zero width code points seems to occupy one column
The text was updated successfully, but these errors were encountered:
ghost
added
Needs-Triage
It's a new issue that the core contributor team needs to triage at the next triage meeting
Needs-Tag-Fix
Doesn't match tag requirements
labels
Feb 4, 2022
Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!
ghost
added
Resolution-Duplicate
There's another issue on the tracker that's pretty much the same thing.
and removed
Needs-Triage
It's a new issue that the core contributor team needs to triage at the next triage meeting
Needs-Tag-Fix
Doesn't match tag requirements
labels
Feb 9, 2022
Windows Terminal version
1.11.3471.0
Windows build number
10.0.19043.1466
Other Software
No response
Steps to reproduce
Running following NET6 code in Windows Terminal:
Expected Behavior
This code creates a string named
s
with one grapheme cluster (👩👩👧👧 and one asterisk). Iterates over both graphemes, printing its code points individually. When the code point U+200d is printed it occupies one column even thought is a 0-width code point.That has the consequence that the grapheme is 11 columns wide (4 * 2+3) instead of 8 columns wide (4 * 2).
Here is a screenshot of the program running in WT:
As you can see, the * starts in column 12, and the individual U+200d printed have one column width.
Default Ubuntu terminal seems to handle this a little bit better: although the grapheme cluster is not shown as a single character but a sequence of its individual code points, the U+200d does not have any width, and the overall width of the grapheme is 8:
As you can see, the * starts in column 9 and the U+200d does not have any width
Actual Behavior
Zero width code points seems to occupy one column
The text was updated successfully, but these errors were encountered: