From 3964dc98ed747a81660c83c278bba9225f0791e6 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Mon, 5 Sep 2016 22:15:38 +0300 Subject: [PATCH] Set encoding to utf-8 for demo scripts --- demo/group-file.py | 6 +++--- demo/group-sql.py | 6 +++--- demo/parse-file.py | 4 ++-- demo/parse-sql.py | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/demo/group-file.py b/demo/group-file.py index b8a7021..8d00507 100755 --- a/demo/group-file.py +++ b/demo/group-file.py @@ -8,7 +8,7 @@ from sqlconvert.process_tokens import find_error, StatementGrouper def main(filename): - grouper = StatementGrouper() + grouper = StatementGrouper(encoding='utf-8') with open(filename) as infile: for line in infile: grouper.process_line(line) @@ -18,14 +18,14 @@ def main(filename): if find_error(statement): print("ERRORS IN QUERY") process_statement(statement) - print_tokens(statement) + print_tokens(statement, encoding='utf-8') print() statement._pprint_tree() print("----------") tokens = grouper.close() if tokens: for token in tokens: - print_tokens(token) + print_tokens(token, encoding='utf-8') print(repr(token)) diff --git a/demo/group-sql.py b/demo/group-sql.py index c0bf2d2..101ab4a 100755 --- a/demo/group-sql.py +++ b/demo/group-sql.py @@ -8,7 +8,7 @@ from sqlconvert.process_tokens import find_error, StatementGrouper def main(*queries): - grouper = StatementGrouper() + grouper = StatementGrouper(encoding='utf-8') for query in queries: grouper.process_line(query) if grouper.statements: @@ -17,14 +17,14 @@ def main(*queries): if find_error(statement): print("ERRORS IN QUERY") process_statement(statement) - print_tokens(statement) + print_tokens(statement, encoding='utf-8') print() statement._pprint_tree() print("----------") tokens = grouper.close() if tokens: for token in tokens: - print_tokens(token) + print_tokens(token, encoding='utf-8') print(repr(token)) diff --git a/demo/parse-file.py b/demo/parse-file.py index e19bde2..bba6096 100755 --- a/demo/parse-file.py +++ b/demo/parse-file.py @@ -11,12 +11,12 @@ from sqlconvert.process_tokens import find_error def main(filename): with open(filename) as infile: for query in infile: - for parsed in parse(query): + for parsed in parse(query, encoding='utf-8'): print("----------") if find_error(parsed): print("ERRORS IN QUERY") process_statement(parsed) - print_tokens(parsed) + print_tokens(parsed, encoding='utf-8') print() parsed._pprint_tree() print("----------") diff --git a/demo/parse-sql.py b/demo/parse-sql.py index e4be365..99f8678 100755 --- a/demo/parse-sql.py +++ b/demo/parse-sql.py @@ -10,12 +10,12 @@ from sqlconvert.process_tokens import find_error def main(*queries): for query in queries: - for parsed in parse(query): + for parsed in parse(query, encoding='utf-8'): print("----------") if find_error(parsed): print("ERRORS IN QUERY") process_statement(parsed) - print_tokens(parsed) + print_tokens(parsed, encoding='utf-8') print() parsed._pprint_tree() print("----------") -- 2.39.5