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

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/15111
Author: @michalnpl
Created: 4/4/2023
Status: Merged
Merged: 4/6/2023
Merged by: @DHowett

Base: mainHead: dev/michalnpl/14942_Conhost_doesnt_honour_the_codepage_stored_in_shortcuts_fix


📝 Commits (3)

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 src/propslib/ShortcutSerialization.cpp (+1 -1)

📄 Description

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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/15111 **Author:** [@michalnpl](https://github.com/michalnpl) **Created:** 4/4/2023 **Status:** ✅ Merged **Merged:** 4/6/2023 **Merged by:** [@DHowett](https://github.com/DHowett) **Base:** `main` ← **Head:** `dev/michalnpl/14942_Conhost_doesnt_honour_the_codepage_stored_in_shortcuts_fix` --- ### 📝 Commits (3) - [`3469f1b`](https://github.com/microsoft/terminal/commit/3469f1bfb56decda03d0905fe25be5ead67d055d) Reordering assignment to properly pick up codepage from .lnk shortcuts. - [`b3049b6`](https://github.com/microsoft/terminal/commit/b3049b6fcc1e12528c0e29449b5d9475e324a794) Merge branch 'main' of https://github.com/michalnpl/terminal into dev/michalnpl/14942_Conhost_doesnt_honour_the_codepage_stored_in_shortcuts_fix - [`bfb98ca`](https://github.com/microsoft/terminal/commit/bfb98ca60e369a4926823bf3052654c0a655bb37) Merge branch 'main' of https://github.com/michalnpl/terminal into dev/michalnpl/14942_Conhost_doesnt_honour_the_codepage_stored_in_shortcuts_fix ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/propslib/ShortcutSerialization.cpp` (+1 -1) </details> ### 📄 Description 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 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:40:48 +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#30433