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 --- cpp/src/Slice/Python.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'cpp/src/Slice/Python.cpp') 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", "#"); // -- cgit v1.2.3