diff --git a/bindgen/translation_unit.py b/bindgen/translation_unit.py index 8b446b5..a19e001 100755 --- a/bindgen/translation_unit.py +++ b/bindgen/translation_unit.py @@ -41,6 +41,10 @@ def parse_tu(path, with open(path) as f: src = f.read() + # skip possible invisible BOM character which would lead to clang error later + if src[0] == "\ufeff" : + src = src[1:] + dummy_code = f'{parsing_header}\n{platform_parsing_header}\n{tu_parsing_header}\n{src}' tr_unit = ix.parse('dummy.cxx', args, @@ -54,4 +58,4 @@ def parse_tu(path, tr_unit.path = ('dummy.cxx',path.name) - return tr_unit \ No newline at end of file + return tr_unit