force UTF-8 encoding for python and mercurial

This commit is contained in:
Sebastian Sdorra
2012-02-10 14:04:51 +01:00
parent b25d876f4e
commit a70fd9f31a
2 changed files with 14 additions and 1 deletions

View File

@@ -95,7 +95,16 @@ public class AbstractHgHandler
/** Field description */
public static final String ENV_REVISION_START = "SCM_REVISION_START";
/** Field description */
public static final String ENV_PYTHONIOENCODING = "PYTHONIOENCODING";
/** Field description */
public static final String ENV_HGENCODING = "HGENCODING";
/** Field description */
public static final String ENCODING = "UTF-8";
/** the logger for AbstractHgHandler */
private static final Logger logger =
LoggerFactory.getLogger(AbstractHgHandler.class);
@@ -431,6 +440,10 @@ public class AbstractHgHandler
pb.directory(directory);
Map<String, String> env = pb.environment();
// force utf-8 encoding for mercurial and python
env.put(ENV_PYTHONIOENCODING, ENCODING);
env.put(ENV_HGENCODING, ENCODING);
if (context.isSystemEnvironment())
{

View File

@@ -53,7 +53,7 @@ def openRepository():
def writeXml(doc):
# print doc.toprettyxml(indent=" ")
print doc.toxml()
doc.writexml(sys.stdout, encoding='UTF-8')
def createChildNode(doc, parentNode, name):
node = doc.createElement(name)