擅长:python、mysql、java
<p>我不喜欢使用<code>rename</code>/<code>remove</code>的现有解决方案,因为它们过度简化了<code>inplace</code>标志所做的一些文件处理,例如处理文件模式、处理<code>chmod</code>属性等</p>
<p>在我的例子中,因为我控制代码要运行的环境,所以我决定唯一合理的解决方案是使用locale将我的语言环境设置为UTF8:</p>
<pre><code>export LC_ALL=en_US.UTF-8
</code></pre>
<p>其效果是:</p>
^{pr2}$
<p>潜在的副作用是对其他文件输入和输出的更改,但我不担心这一点。在</p>