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

Messy encoding between GBK and UTF8 on Windows 10 #1128

Open
Jeangowhy opened this issue Mar 26, 2024 · 2 comments
Open

Messy encoding between GBK and UTF8 on Windows 10 #1128

Jeangowhy opened this issue Mar 26, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@Jeangowhy
Copy link

Code editor

Sublime Text 4169

Platform

Windows 10 1903

Version

"bash-language-server": "^5.1.2"

What steps will reproduce the bug?

Start LSP-bash and hover bash script, bash-language-server\src\util\sh.ts will invokes Windows help commang, and return contents encoding with GBK, but Sublime Text want UTF8.

How often does it reproduce? Is there a required condition?

No response

What is the expected behavior?

When hover cursor on those keyword has the same name on Linux and Windows.

What do you see instead?

messy encoding content:

:: [10:03:30.726] <<< LSP-bash (27) (duration: 72ms): {'contents': {'kind': 'markdown', 'value': ' man\n���浱ǰĿ¼�Թ� POPD ����ʹ�ã�Ȼ��ĵ�ָ����Ŀ¼��\n\nPUSHD [path | ..]\n\n path ָ��Ҫ��Ϊ��ǰĿ¼��Ŀ¼��\n\n���������չ�����ã�����һ���������ź�·����PUSHD\n���\ueef9��������·�������ָ��������·����PUSHD ������һ��\nָ��ָ��������Դ����ʱ�������ţ�Ȼ�����øն����������\n�Ÿ��ĵ�ǰ����������Ŀ¼�����Դ� Z: ���·�����ʱ������\n�ţ�ʹ���ҵ��ĵ�һ��û���ù����������š�\n'}}

Additional information

const DOCUMENTATION_COMMANDS = [
{ type: 'help', command: help ${word} | col -bx },
// We have experimented with setting MANWIDTH to different values for reformatting.
// The default line width of the terminal works fine for hover, but could be better
// for completions.
{ type: 'man', command: man -P cat ${word} | col -bx },
{ type: 'help flag', command: ${word} --help | col -bx },
]

@Jeangowhy
Copy link
Author

Troubleshoot on my temporary way:
image

image

@skovhus
Copy link
Collaborator

skovhus commented Mar 29, 2024

Thanks for reporting. Contributions are more than welcome.

@skovhus skovhus added the bug Something isn't working label Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants