mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-27 18:32:54 +00:00
feat(tools): Enforce utf-8 encoding with open() function
This commit is contained in:
@@ -16,7 +16,7 @@ def get_type(action: str) -> str:
|
||||
|
||||
|
||||
def replace_in_file(filename: str, pattern: str, replacement: str) -> None:
|
||||
with open(filename, 'r+') as f:
|
||||
with open(filename, 'r+', encoding='utf-8') as f:
|
||||
content = f.read()
|
||||
overwritten_content = re.sub(pattern, replacement, content, flags=re.M)
|
||||
f.seek(0)
|
||||
|
Reference in New Issue
Block a user