bash-lsp / bash-language-server

A language server for Bash

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Messy encoding between GBK and UTF8 on Windows 10

Jeangowhy opened this issue · comments

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 },
]

Troubleshoot on my temporary way:
image

image

Thanks for reporting. Contributions are more than welcome.