From 656f87f89ca2c2b390a06aefb8ce64c039a616c3 Mon Sep 17 00:00:00 2001 From: Ross Scroggs Date: Mon, 29 Aug 2016 12:46:03 -0700 Subject: [PATCH] Allow charset with gam batch, like gam csv --- src/gam.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gam.py b/src/gam.py index c4f816af..c3142835 100755 --- a/src/gam.py +++ b/src/gam.py @@ -10534,9 +10534,13 @@ def ProcessGAMCommand(args): command = sys.argv[1].lower() if command == u'batch': import shlex - f = openFile(sys.argv[2]) + i = 2 + filename = sys.argv[i] + i, encoding = getCharSet(i+1) + f = openFile(filename) + batchFile = UTF8Recoder(f, encoding) if encoding != u'utf-8' else f items = [] - for line in f: + for line in batchFile: argv = shlex.split(line) if not argv: continue