diff options
author | Patrick Lehmann <Patrick.Lehmann@plc2.de> | 2022-06-21 22:13:10 +0200 |
---|---|---|
committer | Patrick Lehmann <Patrick.Lehmann@plc2.de> | 2022-12-24 09:17:28 +0100 |
commit | 5de428df07c571322cfbc055a780d41f0ce95a67 (patch) | |
tree | baf265884019696de1b5359177970eb3bac52ee4 /pyGHDL/dom | |
parent | a89b2986b4a252ec8ae5a5db920c2e329ad2a9a3 (diff) | |
download | ghdl-5de428df07c571322cfbc055a780d41f0ce95a67.tar.gz ghdl-5de428df07c571322cfbc055a780d41f0ce95a67.tar.bz2 ghdl-5de428df07c571322cfbc055a780d41f0ce95a67.zip |
Change encoding to latin-1 for libghdl (to comply with standard).
It can be monkey-patched via pyGHDL.libGHDL.ENCODING.
(cherry picked from commit 2dd38de9d52493cde7c045ed73a987ed06bf617a)
Diffstat (limited to 'pyGHDL/dom')
-rw-r--r-- | pyGHDL/dom/NonStandard.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pyGHDL/dom/NonStandard.py b/pyGHDL/dom/NonStandard.py index 14f5e1eac..1dbef9a9a 100644 --- a/pyGHDL/dom/NonStandard.py +++ b/pyGHDL/dom/NonStandard.py @@ -59,7 +59,7 @@ from pyGHDL.libghdl import ( errorout_memory, LibGHDLException, utils, - files_map_editor, + files_map_editor, ENCODING, ) from pyGHDL.libghdl.flags import Flag_Gather_Comments from pyGHDL.libghdl.vhdl import nodes, sem_lib @@ -155,11 +155,11 @@ class Document(VHDLModel_Document): self.__domTranslateTime = time.perf_counter() - t1 def __loadFromPath(self): - with self._filename.open("r", encoding="utf-8") as file: + with self._filename.open("r", encoding=ENCODING) as file: self.__loadFromString(file.read()) def __loadFromString(self, sourceCode: str): - sourcesBytes = sourceCode.encode("utf-8") + sourcesBytes = sourceCode.encode(ENCODING) sourceLength = len(sourcesBytes) bufferLength = sourceLength + 128 self.__ghdlFileID = name_table.Get_Identifier(str(self._filename)) |