From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Felix Weilbach Newsgroups: gmane.emacs.devel Subject: JSON parsing of Extended ASCII Date: Tue, 10 May 2022 19:18:37 +0200 Message-ID: <4763d841-54f0-d146-d968-beb7988431ff@t-online.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13028"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue May 10 19:23:22 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1noTZy-00038o-2J for ged-emacs-devel@m.gmane-mx.org; Tue, 10 May 2022 19:23:22 +0200 Original-Received: from localhost ([::1]:43646 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1noTZw-0001KZ-Qh for ged-emacs-devel@m.gmane-mx.org; Tue, 10 May 2022 13:23:20 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48796) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1noTVW-000052-Vc for emacs-devel@gnu.org; Tue, 10 May 2022 13:18:46 -0400 Original-Received: from mailout07.t-online.de ([194.25.134.83]:40668) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1noTVU-0001fJ-Ri for emacs-devel@gnu.org; Tue, 10 May 2022 13:18:46 -0400 Original-Received: from fwd84.dcpf.telekom.de (fwd84.aul.t-online.de [10.223.144.110]) by mailout07.t-online.de (Postfix) with SMTP id 0BCB91615D for ; Tue, 10 May 2022 19:18:40 +0200 (CEST) Original-Received: from [192.168.178.51] ([79.222.239.131]) by fwd84.t-online.de with (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384 encrypted) esmtp id 1noTVP-2j7Lt20; Tue, 10 May 2022 19:18:39 +0200 Content-Language: en-US X-TOI-EXPURGATEID: 150726::1652203119-00009E39-5B108513/0/0 CLEAN NORMAL X-TOI-MSGID: 88ca41bf-e80e-4b6a-8eb2-28e8c889e746 Received-SPF: none client-ip=194.25.134.83; envelope-from=felix.weilbach@t-online.de; helo=mailout07.t-online.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Tue, 10 May 2022 13:22:46 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:289596 Archived-At: Hello, I'm working on source code that has Extended ASCII characters inside comments in it. This is unfortunate because LSP-mode crashes if it encounters an invalid UTF-8 string. I know this mailing list is not about LSP-mode, but I could track down the issue to the function json_stringn() that gets called in lisp_to_json() inside json.c. Visual Studio Code can cope with these files fine and their LSP implementation has no problem with these files. Therefore I think Emacs should handle this situation as well. I want to find a solution to this problem and implement it. What do you think about this problem? Have you ideas for a solution? Should a potential solution be implemented inside Emacs or LSP-mode? I think there could be implemented a function inside Emacs that tries to convert Extended ASCII to UTF-8 and then encodes it to JSON. Kind regards Felix Weilbach