From 5c029d5955b14aaca0e8e388a09f3a8cf62888dd Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 29 Feb 2016 19:11:49 -0800 Subject: [PATCH] Use cp1252 on Windows for the wxWidgets build too, and add a note to the README about it. --- README.rst | 14 ++++++++++++-- buildtools/build_wxwidgets.py | 3 ++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index 6194ece1..8058812c 100644 --- a/README.rst +++ b/README.rst @@ -41,18 +41,28 @@ or building an egg. Using the build.py script allows for greater control over the build process than setup.py does, including commands for performing the various code-generation steps. So developers working on Phoenix itself or building -from a Git checkout, instead of just building it from a source snapshot, -should be using the build.py script. Build.py provides a fairly simple +from a Git checkout, instead of a source snapshot tarball, should be using +the build.py script. The build.py script provides a fairly simple command-line interface consisting of commands and options. To see the full list run ``python build.py --help``. The most important commands are listed below. +**Windows Users NOTE:** If you are building Phoenix on Windows and have a +non-English language installation of Microsoft Visual Studio then you may +need to set the code page in your console window in order to avoid Unicode +decoding errors. For example:: + + chcp 1252 + python build.py ... + + If you just want to do a standard setuptools-style build using setup.py and are using a full source tarball, then you can stop reading at this point. If you want to build from a source repository checkout, or need to make changes and/or to regenerate some of the generated source files, then please continue reading. + Building wxWidgets ------------------ diff --git a/buildtools/build_wxwidgets.py b/buildtools/build_wxwidgets.py index a991c371..19d695fe 100644 --- a/buildtools/build_wxwidgets.py +++ b/buildtools/build_wxwidgets.py @@ -160,7 +160,8 @@ def getoutput(cmd): output = None output = sp.stdout.read() if sys.version_info > (3,): - output = output.decode('utf-8') # TODO: is utf-8 okay here? + outputEncoding = 'cp1252' if sys.platform == 'win32' else 'utf-8' + output = output.decode(outputEncoding) output = output.rstrip() rval = sp.wait() if rval: