Invalid byte sequence in UTF-8 (ArgumentError) in win32/registry.rb
I'm using Vagrant and the VMware workstation plugin to provision a VMware workstation VM
but in the end this doesn't work because I get an error in win32/registry.rb:
"C:/HashiCorp/Vagrant/embedded/lib/ruby/1.9.1/win32/registry.rb:173:in `tr': invalid byte sequence in UTF-8 (ArgumentError)"
The Vagrant debug log which includes the error trace can be found here:
The related Vagrant bug ticket can be found here:
Please let me know if you need any further information on this!
Thanks a lot!
#1 [ruby-core:55401] Updated by nobu (Nobuyoshi Nakada) almost 4 years ago
- Category changed from platform/windows to M17N
- Status changed from Open to Feedback
- ruby -v changed from 1.9.1 to 1.9.3
That line in 1.9.1 is a comment, so it would be 1.9.3.
But why is Encoding.locale_charmap UTF-8 on Windows?
Are you using codepage 65001?
#2 [ruby-core:55412] Updated by thasmo (Thomas Deinhamer) almost 4 years ago
Line 173 in the registry.rb file here on my PC is this one:
super msg.tr("\r", '').chomp
I'm sorry, I don't know how to set locale_charmap
and I'm not sure what a codepage is.
I'm running the App (Vagrant) using Cygwin on the mintty.exe terminal.
If you wanna tell me how to find out the codepage I can provide you with that info.
#6 [ruby-core:55469] Updated by thasmo (Thomas Deinhamer) almost 4 years ago
'ruby' is not installed in my Cygwin environment, but Vagrant
has an embedded version of ruby so I ran the command using it.
./ruby.exe -e'puts Encoding.locale_charmap'
Which gives the output: UTF-8
Not sure if this is the right way to test it.
With this result is it possible to
guess what the cause of the error is?
Can I do anything else to get
this fixed? Just let me know!
#7 [ruby-core:55497] Updated by thasmo (Thomas Deinhamer) almost 4 years ago
So it seems to be a problem with the used shell,
not the terminal. I've now tried Console2 running
the default Windows shell and the ZSH shell from the
Cygwin environment and using the Windows shell it
works, but using ZSH/Cygwin it throws the error.
Executing this: /cygdrive/c/HashiCorp/Vagrant/embedded/bin/ruby.exe --version
gives me: ruby 1.9.3p392 (2013-02-22) [i386-mingw32]
If I comment out line 172 it works.
# msg = msg[0, len].force_encoding(Encoding.find(Encoding.locale_charmap))
I've also found some guy having similar problems (I think):
So not sure if that's related to this encoding problem.
#8 Updated by nobu (Nobuyoshi Nakada) almost 4 years ago
- Status changed from Feedback to Closed
- % Done changed from 0 to 100