emanote icon indicating copy to clipboard operation
emanote copied to clipboard

Encoding issues in Nix install unless `LC_ALL` is set

Open haoyun opened this issue 4 years ago • 5 comments

Describe the bug I have a markdown file with file name in CJK characters. The generated html has name ������.html. Also in terminal,

[Debug#WS.Client.01]  ~~> Identity (Identity (Identity R[LMLType Md]:������))

To Reproduce Steps to reproduce the behavior:

  1. newly created project folder with only one file: 测试.md
  2. run emanote

Expected behavior In terminal and browser, Chinese characters should be properly displayed.

Desktop (please complete the following information):

  • Browser Chrome
  • Version latest

haoyun avatar Sep 13 '21 00:09 haoyun

It works for me:

image

image

image


But I wonder what we can do here to make it behave consistently regardless of the user environment. What happens when you run emanote with LANG=C.UTF-8 and/or LC_ALL=C.UTF-8? See https://github.com/srid/emanote/discussions/120#discussioncomment-1255160

srid avatar Sep 13 '21 14:09 srid

Thanks for the information. With LC_ALL=C.UTF-8, it works.

Then it seems to be a nix problem. It reminds me of a similar problem with hledger https://github.com/simonmichael/hledger/issues/1033#issuecomment-497940396.

haoyun avatar Sep 13 '21 17:09 haoyun

Could you paste the output of env | grep LC and env | grep LANG? Just curious what your user environment already defines.

srid avatar Sep 13 '21 17:09 srid

~/Documents/emanote ❯ env | grep LC 

~/Documents/emanote ❯ env | grep LANG
GDM_LANG=en_US.utf8
LANG=en_US.utf8

haoyun avatar Sep 13 '21 17:09 haoyun

Probably related: https://github.com/srid/neuron/issues/381

The only pending question I guess is whether Emanote should set LOCALE_ARCHIVE as part of its nix derivation.

srid avatar Sep 13 '21 20:09 srid