Skip to content

Latest commit

 

History

History

WideCharRepro

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Wide Character Rendering ReproductionA minimal reproduction app demonstrating incorrect wide/fullwidth Unicode character rendering in terminal emulators.## The ProblemTerminal emulators must advance the cursor by 2 columns for "wide" Unicode characters (East Asian Width = Wide/Fullwidth, emoji with presentation selectors). Some terminals incorrectly advance by only 1 column, causing:- Grid misalignment / display "tearing"- Overlapping text- Broken TUI (text user interface) applications## Screenshots### Correct rendering (Windows Terminal)All grid separators (Γöé) are vertically aligned. Each wide character occupies exactly 2 terminal columns.Correct rendering### Broken rendering (affected terminals)Grid separators are misaligned. Wide characters only advance the cursor by 1 column, causing all subsequent content on the line to shift left.Broken rendering## Running the Reproductionbashdotnet runRequirements: .NET 10 SDK (or change TargetFramework in .csproj to your installed version, e.g., net8.0 or net9.0).## What to Look For1. Test 1ΓÇô2 (Emoji / CJK grids): The Γöé separators should form perfectly vertical columns.2. Test 3 (Mixed content): Lines with mixed narrow + wide characters should fit within the box.3. Test 4 (Programmatic grid): Another grid alignment test with diverse wide characters.4. Test 5 (Column verification): The X markers should all appear at column 20.If any of these are misaligned, the terminal has a wide-character width calculation bug.## Technical DetailsWide characters affected:- Emoji (U+1F600ΓÇôU+1F64F, U+1F900ΓÇôU+1F9FF, etc.)- CJK Unified Ideographs (U+4E00ΓÇôU+9FFF)- CJK Compatibility Ideographs (U+F900ΓÇôU+FAFF)- Fullwidth Forms (U+FF01ΓÇôU+FF60)- Any character with East_Asian_Width property = W (Wide) or F (Fullwidth)The terminal must use the Unicode East_Asian_Width property (or an equivalent wcwidth implementation) to determine cursor advancement after printing each character.## Related Standards- Unicode TR#11 ΓÇô East Asian Width- POSIX wcwidth(3)- Unicode Emoji Presentation