Invalid byte sequence in UTF-8 (ArgumentError) in win32/registry.rb
|ruby -v:||1.9.3||Backport:||1.9.3: REQUIRED, 2.0.0: REQUIRED|
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!
win32/registry.rb: use WCHAR
- ext/dl/win32/lib/win32/registry.rb (Error, API): use WCHAR interfaces. c.f. [Bug #8508]
#1 Updated by Nobuyoshi Nakada almost 2 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 Updated by Thomas Deinhamer almost 2 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 Updated by Thomas Deinhamer almost 2 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 Updated by Thomas Deinhamer almost 2 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 Nobuyoshi Nakada almost 2 years ago
- Status changed from Feedback to Closed
- % Done changed from 0 to 100