回答編集履歴

1

追記

2022/12/27 07:35

投稿

can110
can110

スコア38266

test CHANGED
@@ -1,3 +1,20 @@
1
1
  動作未検証ですが[sikulixで文字化けせずに日本語入力を行う方法](https://auto-worker.com/blog/?p=416)が参考になりそうです。
2
+ すなわち以下のような感じでglobで得たstr型を(Windows環境であればたぶんcp932で?)unicode型に変換してpasteに渡せばうまくいきそうな気がします。
3
+ ```Python
4
+ import glob
5
+
6
+ for p in glob.glob('./*.txt'):
7
+ up = unicode(p, encoding='cp932')
8
+ print p, type(p)
9
+ print up, type(up)
10
+
11
+ """
12
+ .\temp.txt <type 'str'>
13
+ .\temp.txt <type 'unicode'>
14
+ .\あいう.txt <type 'str'>
15
+ .\あいう.txt <type 'unicode'>
16
+ """
17
+ ```
18
+
2
19
  なお`sikulix`はP(J)ython2.7にしか対応していないようなので、他にもいろいろと注意が必要そうです。
3
20