microsoft / microsoft/terminal

Incorrect encoding although code page is correct

Open
#16,708 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-Output Issue-Bug Product-Conhost Resolution-External
Dominant language
C++
Stars
105k
Forks
9.6k
Avg merge
3d 17h
Merged PRs (30d)
29

Description

Windows Terminal version

1.18.10301.0

Windows build number

10.0.19045.0

Other Software

PowerShell 7.4.1
Diagon (diagon.exe from diagon-1.1.156-win64.zip)

Steps to reproduce

This is an issue that occurs on Terminal but not Conhost.

Executing the command diagon Math -- "1+1/2 + sum(i,0,10) = 112/2" would output:

        10         
        ___        
    1   ╲       112
1 + ─ + ╱   i = ───
    2   ‾‾‾      2 
         0         

The output is correct on UTF-8 (65001) and would be broken on "Multilingual (Latin I)" (850).

When incorrect in encoding:

        10         
        ___        
    1   Ôò▓       112
1 + ÔöÇ + Ôò▒   i = ÔöÇÔöÇÔöÇ
    2   ÔÇ¥ÔÇ¥ÔÇ¥      2 
         0         

Expected Behavior

Output should be correct when encoding is UTF-8 (setting code page to 65001)

Actual Behavior

The output is incorrect on Terminal even when the encoding is UTF-8.
I have verified this with chcp and the code page is 65001

Screenshots for reference
Conhost (correct behaviour)

cmd_NLvESW58q5

WIndows Terminal (incorrect behaviour)

WindowsTerminal_U13vuiXMJk

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Diagon command in Windows Terminal with code page 65001, then compare its output with Conhost using the same command. Trace the terminal's handling of the UTF-8 output and the Multilingual (Latin I) code page. Done means the UTF-8 output matches the expected characters in Windows Terminal, as it does in Conhost.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.