Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Garbled characters appear in the Chinese directory(windows-terminal) #1034

Closed
zzx41375004 opened this issue Nov 17, 2024 · 6 comments
Closed

Comments

@zzx41375004
Copy link

In windows-termianl 1.21, vifm can not work when director's name or file's name is Chinese.
image

@xaizek
Copy link
Member

xaizek commented Nov 17, 2024

CJK on Windows is problematic (at least when using PDCurses, as Vifm does). There were previous reports related to Windows Terminal which were "resolved" by:

  • newer versions of Windows Terminal
  • use of WSL

I still don't know why it happens and whether there is an actual issue on Vifm side (PDCurses, really, but I patch it to make CJK work on Windows at all) given that the outcome depends on the version of WT.

Will need to give it a try again, maybe will be more lucky. Please post problematic Chinese file names as text here so I can use them for a test in case the behaviour depends on some specific text.

@zzx41375004
Copy link
Author

Thanks, and i will help you to solve this problem(it bothered me for a long time).
By the way, this problem happens only in WT of new versions, approximately since 1.18.
In low version, like 1.15, vifm works perfectly.

File names

工程伦理.md
数据结构.md
硕士研究生开题报告书-bak.doc
硕士研究生开题报告书.doc
笔记本信息.md
第20次全国代表大会观后感.md
算法导论中文版.pdf
随笔.md
2070276239-朱志先-软件工程.pdf

@xaizek
Copy link
Member

xaizek commented Nov 17, 2024

By the way, this problem happens only in WT of new versions, approximately since 1.18.
In low version, like 1.15, vifm works perfectly.

Thanks, judging by the dates:

  • 2020: display issues
  • May 2020: likely v1.0.1401.0 release
  • no display issues?
  • March 2022: display issues (unknown WT version)
  • September 2022: v1.15.252 release (no issues)
  • September 2023: possibly v1.18.2681.0 release
  • display issues

So far it looks like a problem with WT. Might be able to bisect it a bit to possibly extract some information.

@vodbyte
Copy link

vodbyte commented Dec 3, 2024

As reference, Far Manager also has same problem with default setting.
1

But, if check "Fullwidth-aware rendering" option in "Interface Settings", the problem will be fixed.
2

And this wt Issule
I hope this case can make some help.


os: win11
window terminal 1.21

@xaizek
Copy link
Member

xaizek commented Dec 3, 2024

Thanks, @vodbyte. I'm yet to test it, but I likely understand what's going on: WT changed how it treats wide characters multiple times. The patch which I apply to pdcurses pads characters that are wider than a single cell (so a Chinese character is printed as 2 characters to tell the terminal that 2 cells are used), because that makes it work with cmd.exe (and some versions of WT). Apparently, this has to be an option (after testing and confirming the cause), because WT being inconsistent might change the behaviour in the future.

@xaizek xaizek added this to the 0.14 release milestone Dec 18, 2024
@xaizek xaizek closed this as completed in 7db041f Dec 22, 2024
@xaizek
Copy link
Member

xaizek commented Dec 22, 2024

Not adding an option, because it doesn't seem to be helpful. After dropping the padding from the output and switching to PDCurses v3.9, both new and old WT seem to display things well:

VirtualBox_win10_22_12_2024_17_07_33

Testing it in cmder, pure ConEmu, cmd.exe didn't reveal any regressions. Quite the opposite, ConEmu now displays CJK well unless you use colors >= 16 while previously the output didn't look good regardless of the colors.

You can grab latest Windows builds from https://builds.vifm.info/ to test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants