{"published":"2023-10-01 16:22:28","author_name":"HTN20190109","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fhtn20190109.hatenablog.com%2Fentry%2F2023%2F10%2F01%2F162228\" title=\"{Python}UTF8\u30d5\u30a1\u30a4\u30eb\u306eBase64\u30a8\u30f3\u30b3\u30fc\u30c9 - HTN20190109\u306e\u65e5\u8a18\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","provider_name":"Hatena Blog","height":"190","blog_title":"HTN20190109\u306e\u65e5\u8a18","image_url":null,"type":"rich","blog_url":"https://htn20190109.hatenablog.com/","categories":["Python"],"provider_url":"https://hatena.blog","url":"https://htn20190109.hatenablog.com/entry/2023/10/01/162228","title":"{Python}UTF8\u30d5\u30a1\u30a4\u30eb\u306eBase64\u30a8\u30f3\u30b3\u30fc\u30c9","description":"https://pythonmaniac.com/file-rw-newline-code/#index_id3 import base64 with open('test2.txt', 'w', encoding='utf-8', newline='') as f: f.write('\u30c6\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u3067\u30591\\r\\n') f.write('\u30c6\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u3067\u30592\\r\\n') with open('test2.txt', \"r\", encoding='utf-8', newline='') as f: print( f.read() ) with open('test2.txt', \"r\", enc\u2026","version":"1.0","width":"100%","author_url":"https://blog.hatena.ne.jp/HTN20190109/"}