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

Failed to format a file containing non-ASCII UTF-8 characters #1236

Closed
sile opened this issue Mar 5, 2022 · 0 comments · Fixed by #1496
Closed

Failed to format a file containing non-ASCII UTF-8 characters #1236

sile opened this issue Mar 5, 2022 · 0 comments · Fixed by #1496
Labels
bug Something isn't working

Comments

@sile
Copy link

sile commented Mar 5, 2022

Describe the bug

I used the formatting feature to format a file containing non-ASCII UTF-8 characters and the result contained garbled characters.

BTW, I have fixed this problem in my forked branch (sile/erlang_ls#fix-unicode-handling). So, I can create an PR if it's okay.

To Reproduce

Please format the following file using the latest erlang_ls version (v0.25.0).

-module(test).

-export([foo/0]).

foo() ->
%% 👍😀🎉
    bar.

Expected behavior

The expected result is,

-module(test).

-export([foo/0]).

foo() ->
    %% 👍😀🎉
    bar.

Actual behavior

The actual result is,

-module(test).

-export([foo/0]).

foo() ->
    %% ð\237\221\215ð\237\230\200ð\237\216\211
    bar.

Context

  • erlang_ls version (tag/sha): 0.25.0
  • Editor used: Emacs
  • LSP client used: lsp-mode
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

Successfully merging a pull request may close this issue.

1 participant