Skip to content

Environment variable LANG #435

@randy3k

Description

@randy3k

Recently, I notice that languageserver fails in some subtle way when the LANG variable is not set.
More precisely, the json returns by the server will be garbled if it contains any non-ascii chars.

It is caused by the fact that R will dump non-ascii chars in their literal form. It causes a dismatch in their number of bytes of the json and the calculated length of the json message.

(=)-~$ Rscript -e "cat('\U2018\n')"
‘
(=)-~$ LANG= Rscript -e "cat('\U2018\n')"
<U+2018>

I observed this bug in the recent version of languageserver when I am hovering on some text on Sublime Text and the doc rendered by html_to_markdown contains the char . It is particularly an issue of Sublime Text because the variable LANG is not set in default.

Any suggestion on how to handle it? It could be an ongoing reason of issues.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions