Windowsの文字化け

export JSON

import json

text = json.dumps(
    {"text":"あ"}, 
    sort_keys=True, 
    indent=4, 
    separators=(',', ': '),
    ensure_ascii=False,
)

with open("conv.json", "w", encoding='utf-8') as fd:
    fd.write(text)
    fd.close()

https://qiita.com/kurousa/items/f59ea18db9e33ef446f0

Print text

import sys
import io
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
print('あ')

https://qiita.com/eleven-junichi2/items/f3fcb6abe7fe21a4d89a https://teratail.com/questions/130659