##// END OF EJS Templates
Use emacs-recognised encoding declaration.
Thomas Kluyver -
Show More
@@ -24,7 +24,7 from .nbbase import new_code_cell, new_text_cell, new_worksheet, new_notebook
24 24 # Code
25 25 #-----------------------------------------------------------------------------
26 26
27 _encoding_declaration_re = re.compile(r"^#\s*coding[:=]\s*([-\w.]+)")
27 _encoding_declaration_re = re.compile(r"^#.*coding[:=]\s*([-\w.]+)")
28 28
29 29 class PyReaderError(Exception):
30 30 pass
@@ -113,7 +113,7 class PyReader(NotebookReader):
113 113 class PyWriter(NotebookWriter):
114 114
115 115 def writes(self, nb, **kwargs):
116 lines = [u'# coding: utf-8']
116 lines = [u'# -*- coding: utf-8 -*-']
117 117 lines.extend([u'# <nbformat>2</nbformat>',''])
118 118 for ws in nb.worksheets:
119 119 for cell in ws.cells:
@@ -81,7 +81,7 nb0 = new_notebook(
81 81 metadata=md
82 82 )
83 83
84 nb0_py = """# coding: utf-8
84 nb0_py = """# -*- coding: utf-8 -*-
85 85 # <nbformat>2</nbformat>
86 86
87 87 # <htmlcell>
General Comments 0
You need to be logged in to leave comments. Login now