Skip to content

feat: changing codepage#104

Open
taizod1024 wants to merge 1 commit intorundeck-plugins:masterfrom
taizod1024:issues/103
Open

feat: changing codepage#104
taizod1024 wants to merge 1 commit intorundeck-plugins:masterfrom
taizod1024:issues/103

Conversation

@taizod1024
Copy link

@taizod1024 taizod1024 commented Feb 18, 2024

If the environment variable RD_NODE_CODEPAGE is set, change the codepage.
The implementation method is the same as the RD_NODE_OUTPUT_CHARSET of winrm_exec.py.

seealso: #103 (comment)
file: py-winrm-plugin-2.1.3+104.zip

@taizod1024 taizod1024 changed the title feat: chainging codepage feat: changing codepage Feb 18, 2024
@taizod1024 taizod1024 marked this pull request as draft June 1, 2024 00:36
@taizod1024 taizod1024 marked this pull request as ready for review June 1, 2024 00:36
@taizod1024
Copy link
Author

@fdevans @ltamaster

@fdevans fdevans requested a review from Copilot March 18, 2026 21:36
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for overriding the WinRM shell codepage via the RD_NODE_CODEPAGE environment variable, aligning behavior with the existing RD_NODE_OUTPUT_CHARSET override pattern used elsewhere in the plugin.

Changes:

  • Introduce a default codepage (65001) and allow override from RD_NODE_CODEPAGE.
  • Pass the selected codepage value into self.protocol.open_shell(...) instead of a hardcoded literal.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +73 to +80
DEFAULT_CODEPAGE = 65001
codepage = DEFAULT_CODEPAGE
if "RD_NODE_CODEPAGE" in os.environ:
codepage = os.getenv("RD_NODE_CODEPAGE")

while retryCount < retry:
try:
shell_id = self.protocol.open_shell(codepage=65001, env_vars=envs)
shell_id = self.protocol.open_shell(codepage=codepage, env_vars=envs)
Comment on lines +73 to +74
DEFAULT_CODEPAGE = 65001
codepage = DEFAULT_CODEPAGE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants