Open lsq opened 1 month ago
Hm, I did not see the error message from your video. Does it happen with vim --clean
? Is there a reason, you do not run in UTF-8 codepage by default? I think this is now the default for the new Windows terminal anyhow.
Hm, I did not see the error message from your video. Does it happen with
vim --clean
? Is there a reason, you do not run in UTF-8 codepage by default? I think this is now the default for the new Windows terminal anyhow.
set play ratio 0.25, at 11s show the error message.
I test vim --clean
with same problem using latest Windows Terminal Preview. In Windows Chinese the system's default codepage is cp936
. But powshell uses CHCP 65001
to no effect, even though the actual CHCP output code is already 65001. However, utF-8 Chinese characters are still garbled.
One solution is to turn on utf-8 in the language set by the system. This does work, but some old applications not support utf8, so there will be some problems.
Is it possible to set the LANG
environment variable in windows and vim to read the lang environment variable not system's codepage?
@chrisbra hi,after a week of testing, I found the reason: setlocale setting code (cp936) is inconsistent with bind_textdomain_codeset (VIMPACKAGE, 'utf-8'). Before terminal output, the utf-8 encoding is recognized as the encoding set by setlocale (p936), so it appears Garbled code, is it possible to fixe it by vim application without changing terminal settings?
is inconsistent with bind_textdomain_codeset (VIMPACKAGE, 'utf-8')
Where do you have set? And isn't your Vim running with utf-8 encoding?
is inconsistent with bind_textdomain_codeset (VIMPACKAGE, 'utf-8')
Where do you have set? And isn't your Vim running with utf-8 encoding?
Yes, my vim set running with utf-8 encoding. In mbyte.c
, I set bind_textdomain_codeset (VIMPACKAGE, 'cp936') replacing enc_utf8 ? "utf-8" : (char *)p_enc
,then the message normal. And enc_utf8 ? "utf-8" : (char *)p_enc
and p_enc
always return utf-8
,
well then try running vim with :set encoding=cp936
. Then p_enc
should be cp936
. But I think you should rather convert to utf-8 instead.
But I think you should rather convert to utf-8 instead.
Right, with setting :set encoding=cp936
, not only the message is garbled, but also the text file's content. And p_enc
is still utf-8
, not cp936
.
Steps to reproduce
Install vim from vim-win32-installer, then open MINGW64 zsh in windows terminal or open cmd.exe/powershell; command
The prompt message is garbled; if
chcp 65001
is used before the above command,cmd.exe
andmingw64 zsh.exe
are normal (thepower shell
environment is still garbled, and the input/output encoding is set to utf-8 and is normal) How to set up normal output of messages that does not depend on specific environmenthttps://github.com/user-attachments/assets/7701a124-b1c1-4fbf-8e15-9c2328716d64
Expected behaviour
A normal message should say that
2 个文件等待编辑
Version of Vim
9.1.X
Environment
OS: Windows 10 x86_64 Shell: zsh 5.9(mingw64) / cmd.exe /power shell windows terminal
:lang
outputLogs and stack traces
No response