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

incompatible character encodings: CP850 and Windows-1252 #3937

Closed
heliobarbosa opened this issue May 30, 2014 · 27 comments
Closed

incompatible character encodings: CP850 and Windows-1252 #3937

heliobarbosa opened this issue May 30, 2014 · 27 comments

Comments

@heliobarbosa
Copy link

When the user profile directory has accent, vagrant opens its beak, he can not read environment variables, because some of them are pulling something from the user profile directory it can not convert the charset

C:\Users\Hélio\Downloads>vagrant box add sonbox.box
C:/HashiCorp/Vagrant/embedded/gems/gems/bundler-1.6.2/lib/bundler/runtime.rb:224:in join': incompatible character encodings: CP850 and Windows-1252 (Encoding::Compatibil ityError) from C:/HashiCorp/Vagrant/embedded/gems/gems/bundler-1.6.2/lib/bundler/runtim e.rb:224:insetup_environment'
from C:/HashiCorp/Vagrant/embedded/gems/gems/bundler-1.6.2/lib/bundler/runtim
e.rb:15:in setup' from C:/HashiCorp/Vagrant/embedded/gems/gems/bundler-1.6.2/lib/bundler.rb:127 :insetup'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.2/bin/vagrant:71:in
`

'

@insign
Copy link

insign commented Jun 27, 2014

+1 - Maybe the 'é' in Hélio user?

@heliobarbosa
Copy link
Author

that's right, but it is still a bug

2014-06-27 16:23 GMT-03:00 insign notifications@github.com:

+1 - Maybe the 'é' in Hélio user?


Reply to this email directly or view it on GitHub
#3937 (comment).

@Sixtisam
Copy link

Sixtisam commented Jul 6, 2014

This bug is very annoying, do I have to create a new windows user profile for running vagrant? Or is there a workaround? My User has a "ä" in the name and I have the same problem.

@heliobarbosa
Copy link
Author

I created a new user and works
Em 06/07/2014 06:24, "Sixtisam" notifications@github.com escreveu:

This bug is very annoying, do I have to create a new windows user profile
for running vagrant? Or is there a workaround? My User has a "ä" in the name


Reply to this email directly or view it on GitHub
#3937 (comment).

@vassilevsky
Copy link
Contributor

I am having the same issue with my Russian username. Only in my case the encodings are IBM866 and Windows-1251.
I've done some debugging and found out that the problem is in ENV['GEM_HOME'] value — it contains the username encoded in what appears to be UTF-8 yet the string's #encoding returns "ASCII-8BIT". Ruby cannot join it with the others.
When I tried to find where the misencoded string comes from, I got lost :)

@heliobarbosa
Copy link
Author

yes, just need fix this line in ruby file.
but a don`t know nothing about ruby...

2014-07-17 12:40 GMT-03:00 Ilya Vassilevsky notifications@github.com:

I am having the same issue with my Russian username. Only in my case the
encodings are IBM866 and Windows-1251.
I've done some debugging and found out that the problem is in
ENV['GEM_HOME'] value — it contains the username encoded in what appears
to be UTF-8 yet the string's #encoding returns "ASCII-8BIT". Ruby cannot
join it with the others.
When I tried to find where the misencoded string comes from, I got lost :)


Reply to this email directly or view it on GitHub
#3937 (comment).

@sztupy
Copy link

sztupy commented Jul 24, 2014

A quick hack would be to modify the first few lines in c:\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.6.3\bin\vagrant:

#!/usr/bin/env ruby

Encoding.default_external = Encoding.find('Windows-1250')
Encoding.default_internal = Encoding.find('Windows-1250')

# Trap interrupts to quit cleanly. This will be overridden at some point
# by Vagrant. This is made to catch any interrupts while Vagrant is
# initializing which have historically resulted in stack traces.

etc.

Don't forget to replace the string in the findwith the second encoding in your error message, e.g. Windows-1252 in your case

Note that this will also mean that your vagrant files might break if they contain characters that are not in the specified encoding, but all-ASCII files should be okay.

@Anticom
Copy link

Anticom commented Jul 28, 2014

Quick Note: On Windows 7 the appropriate character encoding seems to be Windows-1252

I don't get the encoding error anymore, but:

Vagrant failed to initialize at a very early stage:

The home directory you specified is not accessible. The home
directory that Vagrant uses must be both readable and writable.

You specified: C:/Users

How do I change the home directory?

I'm running a fresh Vagrant 1.6.3 installation on Win7 (64Bit).

@sztupy
Copy link

sztupy commented Jul 28, 2014

@Anticom if you just call vagrant as the administrator user it will work, just pollute your /c/Users directory a bit.

@Anticom
Copy link

Anticom commented Jul 28, 2014

@sztupy My own account has admin permissions. 😮

@vassilevsky
Copy link
Contributor

#4159 fixes that

@sztupy
Copy link

sztupy commented Jul 28, 2014

@Anticom if you have UAC turned on then no, you don't

@Anticom
Copy link

Anticom commented Jul 28, 2014

@sztupy Oh okay. And you are saying, that if i boot a vagrant VM as admin it will work lateron on my account?

@mitchellh
Copy link
Contributor

This is a dupe of #2113. We're still not sure how to fix this yet. :(

@luisrudge
Copy link

please fix this

@sethvargo
Copy link
Contributor

Hi @luisrudge - we would love to fix it, but we don't have a good solution yet :frowny:

@luisrudge
Copy link

what about chcp 1252 on the command line?

image

@wzooff
Copy link

wzooff commented Nov 18, 2014

@Anticom I had set up system variable VAGRANT_HOME where specify path to my vagrant project (where i have rw access)

@andrey-borgoyakov
Copy link

Solved this bug, just set VAGRANT_HOME variable in CMD like this:
set VAGRANT_HOME=C:\HashiCorp\Vagrant

This patch C:\HashiCorp\Vagrant by default install vagrant. Worked for me (OS Windows 8.1 x64)

@andreroggeri
Copy link

I fixed this issue by using the command above

set VAGRANT_HOME=C:\HashiCorp\Vagrant

AND

Changing the default VM folder on VirtualBox preferences

@JosepUR
Copy link

JosepUR commented Jul 15, 2015

@andreroggeri this fixed for me too, my user name has an "é" character in it as well, so vagrant was probably bugging when checking the default vm folder wich was located under the "users/myusérname" folder, i just changed it to a generic folder "C:\VMs" and it worked.

@jhessamanda
Copy link

Please!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! someone help me with this error? JESSICA-PC@JESSICA MINGW64 ~/desktop/blog/projeto (master)
$ git add --all

JESSICA-PC@JESSICA MINGW64 ~/desktop/blog/projeto (master)
$ git commit -m "ajustes no bootstrap"
[master af559d8] ajustes no bootstrap
2 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 index.html
create mode 100644 scss/vendors/plugins.scss

JESSICA-PC@JESSICA MINGW64 ~/desktop/blog/projeto (master)
$ sass --no-cache --watch scss:css --style compressed

Sass is watching for changes. Press Ctrl-C to stop.
directory css/vendors
write css/vendors/plugins.css
write css/vendors/plugins.css.map
Encoding::CompatibilityError: incompatible character encodings: Windows-1252 and CP850
Use --trace for backtrace.

@rvanmil
Copy link

rvanmil commented Dec 16, 2015

@andreroggeri 👍

@diezcode
Copy link

amazing that this command fixed my vagrant bug with my name = Stéphane "é"
with this on my folder = set VAGRANT_HOME=C:\HashiCorp\Vagrant
The issue is gone. Is vagrant making an update for the new updates?

@istvan-ujjmeszaros
Copy link

I had to revert to 1.8.7 as 1.9 seems to have issues on Windows with curl and I couldn't fix that.
The set VAGRANT_HOME=C:\HashiCorp\Vagrant fix works, but I had to run vagrant up from a command prompt with admin rights.
Guys, it would be really great if you could test vagrant on Windows before publishing it.

@Traxpoint
Copy link

Traxpoint commented Apr 21, 2018

Got this issue with version 2.0.4, could get it running with the solutions from this forum.

set VAGRANT_HOME=C:\HashiCorp
and
have moved VirtualBox path from users directory to c:\Virtual Box VMs

@ghost
Copy link

ghost commented Mar 30, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Mar 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests