|
16 | 16 | import string
|
17 | 17 | import sys
|
18 | 18 | import sublime, sublime_plugin
|
| 19 | +import codecs |
19 | 20 | from collections import defaultdict
|
20 | 21 | from queue import *
|
21 | 22 | from threading import Timer, Thread
|
@@ -270,7 +271,7 @@ def process_existing_include(self, file_name):
|
270 | 271 |
|
271 | 272 | base_includes = set()
|
272 | 273 |
|
273 |
| - with open(file_name, 'r') as f: |
| 274 | + with codec.open(file_name, 'r', "utf-8") as f: |
274 | 275 | print ('Processing Include File %s' % file_name)
|
275 | 276 | includes = includes_re.findall(f.read())
|
276 | 277 |
|
@@ -298,7 +299,7 @@ def load_from_file(self, view_file_name, base_file_name, parent_node, base_node,
|
298 | 299 | if not node_added or not exists:
|
299 | 300 | return
|
300 | 301 |
|
301 |
| - with open(file_name, 'r') as f: |
| 302 | + with codecs.open(file_name, 'r', "utf-8") as f: |
302 | 303 | print ('Processing Include File %s' % file_name)
|
303 | 304 | includes = re.findall('^[\\s]*#include[\\s]+[<"]([^>"]+)[>"]', f.read(), re.MULTILINE)
|
304 | 305 |
|
@@ -416,7 +417,7 @@ def process_buffer(text, node):
|
416 | 417 |
|
417 | 418 |
|
418 | 419 | def process_include_file(node):
|
419 |
| - with open(node.file_name) as file: |
| 420 | + with codecs.open(node.file_name, "r", "utf-8") as file: |
420 | 421 | process_lines(file, node)
|
421 | 422 |
|
422 | 423 |
|
@@ -585,6 +586,7 @@ def get_full_function_string(line_reader, node, buffer, found_comment, brace_lev
|
585 | 586 | temp = ''
|
586 | 587 | full_func_str = None
|
587 | 588 | open_paren_found = False
|
| 589 | + |
588 | 590 | while buffer is not None:
|
589 | 591 | buffer = buffer.strip()
|
590 | 592 | if not open_paren_found:
|
|
0 commit comments