Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing codepage in WinRM #103

Open
taizod1024 opened this issue Feb 17, 2024 · 3 comments
Open

Changing codepage in WinRM #103

taizod1024 opened this issue Feb 17, 2024 · 3 comments

Comments

@taizod1024
Copy link

taizod1024 commented Feb 17, 2024

I want to change the codepage of py-winrm-plugin.
The codepage of the server I'm using is 932, but the py-winrm-plugin uses a fixed value of 65001.

shell_id = self.protocol.open_shell(codepage=65001, env_vars=envs)

@taizod1024 taizod1024 changed the title Changing the codepage in WinRM Changing codepage in WinRM Feb 18, 2024
@hidehara
Copy link

Is this suitabule for your situation? If so , you just add one line in your node definition.

rundeck node definition can have the following line:

  • output-charset: 'shift_jis'

The above fix was merged v.2.1.2

I'm not sure it already documented but it works in my environment ( WS2012 & WS2019 Japanese version ).

@taizod1024
Copy link
Author

Thanks for the reply.
I also tried output-charset, but it didn't work like below in my environment (rundeck: Win10 22H2, windows node: WS2019)

99.99.99.99:
  nodename: 99.99.99.99
  hostname: 99.99.99.99
  osFamily: Windows
  output-charset: shift_jis
  tags: ''

image

Below are the results of trying various combinations. I don't know what the factors are yet.

output-charset file.encoding codepage in winrm_session.py run in node show result
- - (65001) work fine show garbled characters
shift_jis - (65001) work fine show garbled characters
- Shift-JIS (65001) work with garbled characters error with 'cp932' codec can't encode character '\ufffd'
shift_jis Shift-JIS (65001) work with garbled characters error with 'cp932' codec can't encode character '\ufffd'
shift_jis Shift-JIS 932 work fine show fine

@hidehara
Copy link

I see your situation. I missunderstand the below.

The codepage of the server I'm using is 932, but the py-winrm-plugin uses a fixed value of 65001.

My environment is rundeck server: Ubuntu20.04, windows node: WS2012 & WS2019 (Japanese) . My server is not using 932. It is different with your environment.

In the case which rundeck on Japanese Windows may need your change, I think.

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

No branches or pull requests

2 participants