summaryrefslogtreecommitdiff
path: root/cpp
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 /cpp
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 'cpp')
-rw-r--r--cpp/src/Slice/Python.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/cpp/src/Slice/Python.cpp b/cpp/src/Slice/Python.cpp
index 09a17a93b4a..4343456efb2 100644
--- a/cpp/src/Slice/Python.cpp
+++ b/cpp/src/Slice/Python.cpp
@@ -665,6 +665,10 @@ Slice::Python::compile(int argc, char* argv[])
}
FileTracker::instance()->addFile(file);
+ //
+ // Python magic comment to set the file encoding, it must be first or second line
+ //
+ out << "# -*- coding: utf-8 -*-\n";
printHeader(out);
printGeneratedHeader(out, base + ".ice", "#");
//