New issue
Advanced search Search tips

Issue 393 link

Starred by 9 users

Issue metadata

Status: New
Owner: ----

Sign in to add a comment

Allow latin-1 character encoding in user directory

Reported by, Dec 12 2013

Issue description

What steps will reproduce the problem?
1. using node-gyp on any system where the user name has latin-1 characters

What is the expected output? What do you see instead?
to generate the .vcxproj in UTF-8 encoding (currently is in ASCII)

What version of the product are you using? On what operating system?
0.12.1 on Windows 8.1

Please provide any additional information below.
WriteXmlIfChanged on pylib/gyp/ actually output to ascii encoding. Converting directly to utf-8 fails, so unidecode needs to be used first.

This path was a very quick fix that works for me, but more work needs to be done, like detecting the native enconding ro something like that. In may case it was latin-1, but it might be others.


Comment 1 by, Dec 12 2013

Sorry it was unicode not unidecode

Comment 2 by, Jun 28 2014

This simple patch solves the problem when building on windows with usernames with non-ascii letters.

On the file  pylib/gyp/

Simply find this pieace of code

  # It has changed, write it
  if existing != xml_string:
    f = open(path, 'w')

and change to something like this:

  # It has changed, write it
  if existing != xml_string:
    f = open(path, 'w')
      xml_string = xml_string.encode(encoding)
    except Exception:
      xml_string = unicode(xml_string, 'latin-1').encode(encoding)

Sign in to add a comment