fgg blog

wsl2_and_unicode

# 关于 locale,unicode,json.dump() 以及被冤枉的 WSL2

WSL2的 locale 一直是默认设置值 – “C.UTF-8”。然后今天用 python 解析路径文件中文名时, 最终保存下来的竟是 unicode ("\u5c0f\u6728\u4ed4-\u7761\u7740\u4e862"),这倒是破天荒第一 次碰上 :’) 为了省事,必须去找 GPT 阁下。

更新:下文是完全绕了远路了的。造成上述情况的实际原因应该是:json.dump() 默认参数中的 ensure_ascii=True,这就决定了写入文件的字符不会超出ASCII字符集。

所以,正确的修改方式不是大费周章的改写系统 locale 而是将参数改为 ensure_ascii=False

实际上,json.dump() 这部分的函数也是 GPT 阁下写的,它理所当然地认为是在英文语境中,使用 默认的参数不为过吧。😂

poor_dad

地铁口出口处。立着的行李箱上儿子半跪着倾向爸爸,爸爸一只手抓着行李箱杆子,另一只手拿着手机。 女儿在旁边也想往行李箱上挤,被爸爸制止。女儿开始有哭腔,爸爸没看她,注意力全在手机上, 大约是在打车、看地图、联系人或者玩游戏,不知道。女儿三番两次,还是不行,被爸爸大声呵斥危险。 后面她干脆往地上就是一坐,赖哭着乱踢双腿。赖哭声里传达的大约是委屈的信号(前不久我刚领教 过我大舅哥他那差不多年纪大的幼稚园女儿的赖地式哭闹,所以对这个信号颇为熟悉)。

等我走下地铁口,委屈信号已经变成多个均匀间隔的求关注信号了。

python_module

# Layout of Python installations

All paths in the table are relative to the installation root:

FilesWindowsLinux and macOSNotes
Interpreterpython.exebin/python3.x
Standard libraryLib and DLLslib/python3.xExtension modules are located under DLLs on Windows. Fedora places the standard library under lib64 instead of lib.
Third-party packagesLib\site-packageslib/python3.x/site-packagesDebian and Ubuntu put packages in dist-packages. Fedora places extension modules under lib64 instead of lib.
Entry-point scriptsaScriptsbin