From 07ddf8de45e019061faf62ae9b043371c1f19dd3 Mon Sep 17 00:00:00 2001 From: Eric Vergnaud Date: Sun, 11 Oct 2020 09:24:37 +0800 Subject: [PATCH] fix failing Python2 tests with utf-8 encoding --- runtime/Python2/src/antlr4/InputStream.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/Python2/src/antlr4/InputStream.py b/runtime/Python2/src/antlr4/InputStream.py index c0eb71f70..1cad2c190 100644 --- a/runtime/Python2/src/antlr4/InputStream.py +++ b/runtime/Python2/src/antlr4/InputStream.py @@ -15,9 +15,9 @@ import sys class InputStream (object): - def __init__(self, data, encoding = "ascii"): + def __init__(self, data, encoding = "utf-8"): self.name = "" - self.strdata = unicode(data, encoding) + self.strdata = unicode(data, encoding) if encoding != "utf-8" else data self._loadString() def _loadString(self):