-
when I launch lsp server with --encoding utf-8 and then send a request, server writes BOM to stdout first:

because Encoding.GetEncoding("utf-8") gets utf-8 encoding with BOM
|
var encoding = Encoding.GetEncoding(application.Encoding); |
|
Console.InputEncoding = encoding; |
|
Console.OutputEncoding = encoding; |
-
If --encoding utf-8 is not specified and my system's default encoding is also utf-8, the server does not write a BOM to stdout.
Considering that LSP currently only supports utf-8, I'm curious if it's possible to ensure the server consistently use utf-8 without BOM across all platforms (just for lsp case). This would make client-side parsing slightly simpler. BTW, neovim has removed the logic for filtering out BOM in lsp client, so it will throw an error when receiving the message with BOM.
💖
when I launch lsp server with

--encoding utf-8and then send a request, server writes BOM to stdout first:because
Encoding.GetEncoding("utf-8")gets utf-8 encoding with BOMomnisharp-roslyn/src/OmniSharp.Stdio.Driver/Program.cs
Lines 27 to 29 in 258e5d0
If
--encoding utf-8is not specified and my system's default encoding is also utf-8, the server does not write a BOM to stdout.Considering that LSP currently only supports utf-8, I'm curious if it's possible to ensure the server consistently use utf-8 without BOM across all platforms (just for
lspcase). This would make client-side parsing slightly simpler. BTW, neovim has removed the logic for filtering out BOM in lsp client, so it will throw an error when receiving the message with BOM.💖