-
Notifications
You must be signed in to change notification settings - Fork 425
Description
-
when I launch lsp server with
--encoding utf-8and then send a request, server writes BOM to stdout first:

becauseEncoding.GetEncoding("utf-8")gets utf-8 encoding with BOM
omnisharp-roslyn/src/OmniSharp.Stdio.Driver/Program.cs
Lines 27 to 29 in 258e5d0
var encoding = Encoding.GetEncoding(application.Encoding); Console.InputEncoding = encoding; Console.OutputEncoding = encoding; -
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 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.
💖