mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-08 22:45:45 +01:00
force UTF-8 encoding for python and mercurial
This commit is contained in:
@@ -96,6 +96,15 @@ public class AbstractHgHandler
|
|||||||
/** Field description */
|
/** Field description */
|
||||||
public static final String ENV_REVISION_START = "SCM_REVISION_START";
|
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 */
|
/** the logger for AbstractHgHandler */
|
||||||
private static final Logger logger =
|
private static final Logger logger =
|
||||||
LoggerFactory.getLogger(AbstractHgHandler.class);
|
LoggerFactory.getLogger(AbstractHgHandler.class);
|
||||||
@@ -432,6 +441,10 @@ public class AbstractHgHandler
|
|||||||
|
|
||||||
Map<String, String> env = pb.environment();
|
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())
|
if (context.isSystemEnvironment())
|
||||||
{
|
{
|
||||||
env.putAll(System.getenv());
|
env.putAll(System.getenv());
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ def openRepository():
|
|||||||
|
|
||||||
def writeXml(doc):
|
def writeXml(doc):
|
||||||
# print doc.toprettyxml(indent=" ")
|
# print doc.toprettyxml(indent=" ")
|
||||||
print doc.toxml()
|
doc.writexml(sys.stdout, encoding='UTF-8')
|
||||||
|
|
||||||
def createChildNode(doc, parentNode, name):
|
def createChildNode(doc, parentNode, name):
|
||||||
node = doc.createElement(name)
|
node = doc.createElement(name)
|
||||||
|
|||||||
Reference in New Issue
Block a user