[PR #15111] Respect the codepage stored in .LNK files in conhost #30438

Closed
opened 2026-01-31 09:40:49 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/15111

State: closed
Merged: Yes


Making Conhost pick up codepage from .lnk files.

Because of the wrong assignment order, the Conhost was not picking up the codepage stored in .lnk shortcut files. This change fixes this issue by changing the order of the assignment to the correct one.

This is a potential backward compatibility issue.

Since this issue has been present in the codebase for years, this change runs a high risk of breaking backward compatibility with software that depends on incorrect behavior.

Validation Steps Performed

Tested fix manually (using chcp command, making sure each .lnk codepage was picked up.) against Debug/Release x64 builds with 5 different .lnk files:

  1. Arabic codepage 1256
  2. Greek 869
  3. Latin2 852
  4. Thai 874
  5. Traditional Chinese 50229

Ran TAEF tests against Debug/Release x64/x86 with identical results as main branch.

Tested against invalid codepage numbers by manually manipulating .lnk file binary. In case of an invalid codepage number, Conhost defaults to a valid default one, which I assume is expected behavior.

Closes #14942

**Original Pull Request:** https://github.com/microsoft/terminal/pull/15111 **State:** closed **Merged:** Yes --- Making Conhost pick up codepage from .lnk files. Because of the wrong assignment order, the Conhost was not picking up the codepage stored in .lnk shortcut files. This change fixes this issue by changing the order of the assignment to the correct one. This is a potential backward compatibility issue. Since this issue has been present in the codebase for years, this change runs a high risk of breaking backward compatibility with software that depends on incorrect behavior. ## Validation Steps Performed Tested fix manually (using **chcp** command, making sure each .lnk codepage was picked up.) against **Debug**/**Release** **x64** builds with **5** different .lnk files: 1. Arabic codepage 1256 2. Greek 869 3. Latin2 852 4. Thai 874 5. Traditional Chinese 50229 Ran TAEF tests against **Debug**/**Release** **x64**/**x86** with identical results as **main** branch. Tested against **invalid** codepage numbers by **manually manipulating .lnk file binary**. In case of an **invalid** codepage number, Conhost defaults to a **valid default one**, which I assume is expected behavior. Closes #14942
claunia added the pull-request label 2026-01-31 09:40:49 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#30438