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"^# |
|
|
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: |
General Comments 0
You need to be logged in to leave comments.
Login now