Skip to content

Error when parsing JSON in Emacs when current-language-environment is "Chinese-GBK" #263

Description

@drcxd

Describe the bug

Execute eca in Emacs prints the following message:

ECA :: Failed to fetch releases: (json-utf8-decode-error 13675 138 728508)

I executed the command in shell and it can download the json string successfully. The string is almost the same in Emacs, but evaluating the downloaded string lead to something like this:

#("..."  28775 32758 (charset chinese-gbk) 728506 737258 (charset chinese-gbk))

It seems that the downloaded string is encoded in chinese-gbk because my Emacs has its current-language-environemnt set to "Chinese-GBK". I guess this is because the language of the OS is set to Chinese, and Emacs automatically detects the OS language and set the language environment accordingly.

Setting language environment to UTF-8 by executing set-language-environment and execute eca again, I can not reproduce the same error.

To Reproduce

  1. Set language environment to Chinese-GBK
  2. Execute eca

This should reproduce the error.

Expected behavior

ECA should be able to handle OS/Emacs environment of other languages.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions