开发者

Create directory with UTF-8 name in Vim

I can not create a directory in russian (UTF-8) using vimscript in WinXP.

For example

:call mkdir("привет")

开发者_Go百科creates directory with привет name instead of привет.

I have also tried

:call system("mkdir привет")

with the same result.

Is it possible?


What I usually do is I switch to the explorer mode with :Explore and press d. It asks me for the directory name, then.

  • :h :Explore
  • :h netrw-d


try this

:!mkdir "привет"


Found it.

I should use iconv function:

:call mkdir(iconv("привет", "utf-8", "cp1251"))


You can change encod. Add:

chcp 65001
:call mkdir("привет")

chcp 65001 - UTF-8

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜