GNU bug report logs - #61726
[PATCH] Eglot: Support positionEncoding capability

Previous Next

Package: emacs;

Reported by: Augusto Stoffel <arstoffel <at> gmail.com>

Date: Thu, 23 Feb 2023 08:06:01 UTC

Severity: normal

Tags: patch

Done: João Távora <joaotavora <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Augusto Stoffel <arstoffel <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 61726 <at> debbugs.gnu.org, João Távora <joaotavora <at> gmail.com>
Subject: bug#61726: [PATCH] Eglot: Support positionEncoding capability
Date: Fri, 24 Feb 2023 15:45:30 +0100
On Fri, 24 Feb 2023 at 15:51, Eli Zaretskii wrote:

>> > > You can't even send or receive a message through the JSONRPC channel if
>> > > it's not valid UTF-8
>> 
>> > That's because we _decided_ to behave like that.  A decision that is
>> > not carved in stone.
>> 
>> At least or LSP, it seems it must be UTF-8:
>
> This is a misunderstanding: I didn't mean to say that we should send
> invalid UTF-8 sequences.  I meant something else.  Quote from the rest
> of my message:
>
>> > and `json-serialize' rightfully emits an error.
>> 
>> There's no "rightfully" here.  It's our decision to signal an error in
>> this case.

In fact, our decision was to follow the JSON specification, which says
UTF-8 is the only allowed exchange encoding:
https://www.rfc-editor.org/rfc/rfc8259#section-8.1

>> Substituting some innocent character for the unencodable
>> ones would be an entirely legitimate alternative.

So actually the answer here is no.  You can save arbitrary bytes in a
file in your laptop and call it data.json.  But it you pass some data to
someone else and promise it's in JSON format, then it _must_ be UTF-8
encoded.




This bug report was last modified 2 years and 138 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.