nvm-windows icon indicating copy to clipboard operation
nvm-windows copied to clipboard

Error output is unreadable when using Simplified Chinese as system language

Open DevDengChao opened this issue 2 years ago • 4 comments

Issue:

This is an example when I run the nvm use 12 WITHOUT administrator privilege:

exit status 5: �ܾ����ʡ�

exit status 1: ���ļ��Ѵ���ʱ���޷��������ļ���

How To Reproduce:

  1. Setup the system language as Simplified Chinese (简体中文)
  2. Execute nvm use 12 (make sure you've already installed it)

Expected Behavior:

The error output should be readable.

Desktop:

  • OS: Windows 10

After searching around go and its charset related document, the workaround maybe not using string comparison here: https://github.com/coreybutler/nvm-windows/blob/master/src/nvm.go#L890-L898 and generate output manually.

DevDengChao avatar Jun 16 '22 04:06 DevDengChao

同样的问题

deathnopool avatar Jul 01 '22 06:07 deathnopool

这得要使用管理员打开

coder-hxl avatar Jul 17 '22 10:07 coder-hxl

这得要使用管理员打开

问题在于, 如果这个报错信息能清晰明了的说明需要使用管理员权限来运行的话, 就能减少很多本地试错的时间.

If we can told the user that we need Administatior permission to run nvm in the error output clearly, then we could save a lot of debuging time for the user.

DevDengChao avatar Jul 17 '22 15:07 DevDengChao

这得要使用管理员打开

确实,我也遇到这个问题了,多谢提醒

duanluan avatar Jul 19 '22 04:07 duanluan

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Aug 19 '22 02:08 github-actions[bot]

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Mar 13 '23 01:03 github-actions[bot]

It looks like you need a way to prevent the bot from marking this issue stale. :rofl:

DevDengChao avatar Mar 14 '23 01:03 DevDengChao

If anyone using simplified Chinese can test with v1.1.11, I'd appreciate it. There is a new encoding mechanism that may resolve this. 🤞

coreybutler avatar Apr 21 '23 04:04 coreybutler

I'm trying the nvm v1.1.11 on Windows 11 with simplified Chinese and a non-admin local account. When I tring to nvm use lts, there is a dialog shows up and asking for admin privilege. 👍

non-admin terminal


When I clicked agree, then nvm switch to lts successfuly. Then I tried again with disagree, it switch to lts successfully again. And I tried nvm off with disagree, it turned off nvm 🤣 I'm not certain if this is a bug with nvm or Windows. If its necessary, I'll capture a screen record and open another issue for it.

DevDengChao avatar Apr 21 '23 06:04 DevDengChao

@DevDengChao thank you for testing!

nvm off with disagree could still work, depending on your setup. I'm not sure why Windows would allow it if you don't agree to elevate permissions, so it might be worth investigating separately. It would be better to track that in another issue though (otherwise it will get buried in this one).

I think the latest updates catch/handle the original error correctly now (i.e. the exit codes), and it looks like the responses are readable now.

If anyone comes across this in the future, please open a new issue referencing this one.

coreybutler avatar Apr 21 '23 14:04 coreybutler