Repository navigation
Respect the codepage stored in .LNK files in conhost - #15111
Merged
Conversation
…/michalnpl/14942_Conhost_doesnt_honour_the_codepage_stored_in_shortcuts_fix
…/michalnpl/14942_Conhost_doesnt_honour_the_codepage_stored_in_shortcuts_fix
michalnpl
marked this pull request as ready for review
April 4, 2023 21:49
Carlos Zamora (carlos-zamora)
requested a review
from Dustin L. Howett (DHowett)
April 5, 2023 20:52
Leonard Hecker (lhecker)
approved these changes
Apr 6, 2023
Member
|
Moved from body of PR Test files are attached:. |
Dustin L. Howett (DHowett)
approved these changes
Apr 6, 2023
Dustin L. Howett (DHowett)
left a comment
Member
There was a problem hiding this comment.
Thanks so much for doing this! I suspected the hard/annoying part would be the testing, and I'm so glad you did it. I'm going to put a note on https://github.com/microsoft/terminal/wiki/Console:-Potential-Breaking-Changes for it.
michalnpl
deleted the
dev/michalnpl/14942_Conhost_doesnt_honour_the_codepage_stored_in_shortcuts_fix
branch
April 7, 2023 05:02
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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