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

Non ascii characters not handled properly #37

Closed
olivernaaris opened this issue Sep 21, 2017 · 1 comment
Closed

Non ascii characters not handled properly #37

olivernaaris opened this issue Sep 21, 2017 · 1 comment

Comments

@olivernaaris
Copy link

I have a issue when I try to use non ascii characters, like for example Japanese characters.
Script that I used to test:

require 'winrm'

opts = {
endpoint: "http://???:5985/wsman",
user: "ア ウェブ",
password: "?????",
overall_timeout: 15,
retry_limit: 3,
retry_delay: 10
}

conn = WinRM::Connection.new(opts)
conn.shell(:powershell) do |shell|
output = shell.run("$PSDefaultParameterValues['Out-File:Encoding'] = 'utf8'") do |stdout, stderr|
STDOUT.print stdout
STDERR.print stderr
end
puts "The script exited with exit code #{output.exitcode}"
end

And error:
/Users/Oliver/.rbenv/versions/2.2.6/lib/ruby/gems/2.2.0/gems/rubyntlm-0.6.2/lib/net/ntlm.rb:166:in upcase': invalid byte sequence in UTF-8 (ArgumentError) from /Users/Oliver/.rbenv/versions/2.2.6/lib/ruby/gems/2.2.0/gems/rubyntlm-0.6.2/lib/net/ntlm.rb:166:in ntlmv2_hash'
from /Users/Oliver/.rbenv/versions/2.2.6/lib/ruby/gems/2.2.0/gems/rubyntlm-0.6.2/lib/net/ntlm/client/session.rb:192:in ntlmv2_hash' from /Users/Oliver/.rbenv/versions/2.2.6/lib/ruby/gems/2.2.0/gems/rubyntlm-0.6.2/lib/net/ntlm/client/session.rb:196:in calculate_user_session_key!'
from /Users/Oliver/.rbenv/versions/2.2.6/lib/ruby/gems/2.2.0/gems/rubyntlm-0.6.2/lib/net/ntlm/client/session.rb:27:in authenticate!' from /Users/Oliver/.rbenv/versions/2.2.6/lib/ruby/gems/2.2.0/gems/rubyntlm-0.6.2/lib/net/ntlm/client.rb:36:in init_context'
from /Users/Oliver/.rbenv/versions/2.2.6/lib/ruby/gems/2.2.0/gems/winrm-2.2.3/lib/winrm/http/transport.rb:229:in init_auth' from /Users/Oliver/.rbenv/versions/2.2.6/lib/ruby/gems/2.2.0/gems/winrm-2.2.3/lib/winrm/http/transport.rb:168:in send_request'
from /Users/Oliver/.rbenv/versions/2.2.6/lib/ruby/gems/2.2.0/gems/winrm-2.2.3/lib/winrm/shells/cmd.rb:56:in open_shell' from /Users/Oliver/.rbenv/versions/2.2.6/lib/ruby/gems/2.2.0/gems/winrm-2.2.3/lib/winrm/shells/base.rb:168:in block in open'
from /Users/Oliver/.rbenv/versions/2.2.6/lib/ruby/gems/2.2.0/gems/winrm-2.2.3/lib/winrm/shells/retryable.rb:37:in retryable' from /Users/Oliver/.rbenv/versions/2.2.6/lib/ruby/gems/2.2.0/gems/winrm-2.2.3/lib/winrm/shells/base.rb:166:in open'
from /Users/Oliver/.rbenv/versions/2.2.6/lib/ruby/gems/2.2.0/gems/winrm-2.2.3/lib/winrm/shells/base.rb:129:in with_command_shell' from /Users/Oliver/.rbenv/versions/2.2.6/lib/ruby/gems/2.2.0/gems/winrm-2.2.3/lib/winrm/shells/base.rb:81:in run'
from winrm_https.rb:24:in block in <main>' from /Users/Oliver/.rbenv/versions/2.2.6/lib/ruby/gems/2.2.0/gems/winrm-2.2.3/lib/winrm/connection.rb:44:in shell'
from winrm_https.rb:23:in `

'

@pcai
Copy link
Contributor

pcai commented Jun 6, 2024

thanks. #55 appears to be a dupe, but it includes a proposed fix, closing in favor of that one

@pcai pcai closed this as completed Jun 6, 2024
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