haskell / docker-haskell

MIT License
63 stars 37 forks source link

locale setting incorrect #29

Closed soiamsoNG closed 3 years ago

soiamsoNG commented 3 years ago

locale -a return

locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_COLLATE to default locale: No such file or directory
C
C.UTF-8
POSIX

affect hGet hPut like function

locale should set to C.UTF-8, to avoid fallback to ASCII since locale setting incorrect

psftw commented 3 years ago

Thank you for reporting. While I can't reproduce the error output lines from calling locale -a in the images, I agree we should be using C.UTF-8 as a default. I think we can just bake LANG=C.UTF-8 into the image (as was the case < GHC 8.6). Will post a PR later today to address.

soiamsoNG commented 3 years ago

Thank you for reporting. While I can't reproduce the error output lines from calling locale -a in the images, I agree we should be using C.UTF-8 as a default. I think we can just bake LANG=C.UTF-8 into the image (as was the case < GHC 8.6). Will post a PR later today to address.

I run under podman rig by vscode remote container I do some research this locale incorrect setting introduce by vscode or remote container who set the locale to en_US.UTF-8

we need to bake LANG=C.UTF-8 but not current POSIX.

psftw commented 3 years ago

Also came across this great post about the topic https://serokell.io/blog/haskell-with-utf8