diff --git a/CHANGELOG.md b/CHANGELOG.md index f0ce7ff..1bec16f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,6 @@ # Changelog +## v0.1.0a2 +- Explicitly set the default file encoding to utf8 ## v0.1.0a1 - Implemented `build`, `make_xml` functions - Added symbols.py and ldscript diff --git a/setup.cfg b/setup.cfg index 4aacd04..f6c5959 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = supSMSGecko -version = 0.1.0a1 +version = 0.1.0a2 author = sup39 author_email = sms@sup39.dev description = A helper library to write Gecko code for Super Mario Sunshine diff --git a/src/supSMSGecko/lib.py b/src/supSMSGecko/lib.py index 76cd4dc..618e1f3 100644 --- a/src/supSMSGecko/lib.py +++ b/src/supSMSGecko/lib.py @@ -18,10 +18,10 @@ def build(main, version): def make_xml( main, versions=VERSIONS, info_xml='info.xml', out_xml='out.xml', - indent=4, tag='code', + indent=4, tag='code', encoding='utf8', ): if type(indent) == int: indent = ' '*indent - with open(out_xml, 'w') as fw: + with open(out_xml, 'w', encoding=encoding) as fw: def write_sources(indent_src): for ver in versions: print(f'{indent_src}', file=fw) @@ -29,7 +29,7 @@ def make_xml( print(f'{indent_src}', file=fw) if info_xml is not None and os.path.isfile(info_xml): found_tag = False - with open(info_xml) as f: + with open(info_xml, encoding=encoding) as f: for line in f: m = re.search(r'^(\s*)', line) if m is not None: