erlang_ls icon indicating copy to clipboard operation
erlang_ls copied to clipboard

UTF-8 characters get garbled after formatting

Open yowcow opened this issue 3 years ago • 0 comments

Describe the bug UTF-8 characters get garbled after formatting.

To Reproduce Have a piece of unformatted code and/or comment that includes multibyte UTF-8 characters, then trigger code formatting.

E.g.

                    %% コメント
    _ = <<
          "こんにちは"/utf8
        >>,

Expected behavior Get a clean piece of code.

E.g.

    %% コメント
    _ = <<"こんにちは"/utf8>>,

Actual behavior Get a garbled piece of code.

E.g.

    %% ã<82>³ã<83>¡ã<83>³ã<83><88>
    _ = <<"ã<81><93>ã<82><93>ã<81>«ã<81>¡ã<81>¯"/utf8>>,

Context

  • erlang_ls version (tag/sha): Version: 0.44.1 (ref: b151f9d9a4a1dde1118ae2822226500e2fa69125)
  • Editor used: neovim v0.8.0
  • LSP client used: Nvim LSP client

This patch resolves the problem: https://github.com/erlang-ls/erlang_ls/compare/main...yowcow:erlang_ls:fix-garbled-utf8-characters

yowcow avatar Oct 18 '22 01:10 yowcow