summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2016-04-28 17:01:06 +0200
committerJose <jose@zeroc.com>2016-04-28 17:45:10 +0200
commit68032fbc4aeac72b2ba064c42444139db9080d0a (patch)
tree2354359c62c06bc72851d2cab24d463ffe82ba99 /python
parentFix to no longer close the socket on fdToString failure, the caller is now cl... (diff)
downloadice-68032fbc4aeac72b2ba064c42444139db9080d0a.tar.bz2
ice-68032fbc4aeac72b2ba064c42444139db9080d0a.tar.xz
ice-68032fbc4aeac72b2ba064c42444139db9080d0a.zip
Add encoding comments to python generated code
Diffstat (limited to 'python')
-rw-r--r--python/modules/IcePy/Slice.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/python/modules/IcePy/Slice.cpp b/python/modules/IcePy/Slice.cpp
index bf856f8b654..a4692f6465f 100644
--- a/python/modules/IcePy/Slice.cpp
+++ b/python/modules/IcePy/Slice.cpp
@@ -161,6 +161,10 @@ IcePy_loadSlice(PyObject* /*self*/, PyObject* args)
ostringstream codeStream;
IceUtilInternal::Output out(codeStream);
out.setUseTab(false);
+ //
+ // Python magic comment to set the file encoding, it must be first or second line
+ //
+ out << "# -*- coding: utf-8 -*-\n";
generate(u, all, checksum, includePaths, out);
u->destroy();