Consensys/python-solidity-parser

Read the file using utf8

Closed this issue · 0 comments

The parser fails reading solidity files. We found that opening the files with utf8 solves it.

def parse_file(path, start="sourceUnit", loc=False, strict=False):
with open(path, 'r', encoding="utf8") as f:

    return parse(f.read(), start=start, loc=loc, strict=strict)

Unlock.sol.txt

For example in the Unlock.sol file.