From 68032fbc4aeac72b2ba064c42444139db9080d0a Mon Sep 17 00:00:00 2001 From: Jose Date: Thu, 28 Apr 2016 17:01:06 +0200 Subject: Add encoding comments to python generated code --- python/modules/IcePy/Slice.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'python/modules/IcePy/Slice.cpp') 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(); -- cgit v1.2.3