@igrep pinned a message to this channel.

（すみません、一度公開してからでは自動で回答締め切りするのが難しそうなのでやっぱり自分でOFFにできる時間帯にします）
@ has joined the channel
@MIYATA Tadaaki has joined the channel
@ has joined the channel

@Akito has joined the channel
@tkch-pe has joined the channel
@nh2 has joined the channel
hi, are there any Japanese Haskell users with Windows around that could try
import GHC.IO.Encoding
getForeignEncoding


for me and tell me what it outputs? I'm trying to fix a bug in Haskell's rocksdb bindings
From my console:

λ stack exec ghci
GHCi, version 8.2.2:   :? for help
[Prelude]
> import GHC.IO.Encoding
[Prelude GHC.IO.Encoding]
> getForeignEncoding
CP932

@watiko has joined the channel
@igrep Thanks a lot. How did you get this setting? Is it what happens when you install a Japanese Windows edition (and which version?), or after changing it from an English install? I'm trying to set my system so I also get CP932
What it outputs, is really depending on the code page which the command prompt (or powershell) uses, by default Windows Japanese edition set it to CP932. If you get other than this, you need to change it to CP932 by calling chcp 932 before running haskell or (I believe) you can use Japanese edition.
Yes, that makes sense. I'm just asking because I want to test my changes on as realistic a Japanese system as I can get (to reproduce the bug found by users reported to run on Japanese Windows), and I'm not sure if just the chcp 932 is enough.
The setting sets set this default seems to be https://knowledgebase.progress.com/articles/Article/4677:
Open Windows Control Panel
Select Region and Language
Under Language for non-Unicode programs, click on Change System Locale
I set this to Japanese (Japan) and after a reboot I got CP932 in the ghci
If the bug (maybe) rely on the result of getForeignEncoding then, I think chcp 932 is just enough, since if we put chcp 65001 and then run getForeignEncoding, it outputs UTF-8, as we intended the result to be.
I agree with りんご姫. If the error is related to character encoding, chcp 65001 or chcp 20127 is usually a sufficient workaround.
(Sorry, this is not translated into English yet...)

@ has joined the channel

@ has joined the channel
@nasa has joined the channel
@igrep @りんご姫 thanks a lot!
Also your linked article seems to be very relevant to me right now.
Can you tell me, does ghc itself usually work when working under the Japenese locale?
For me, when I run stack exec -- ghc --version with the locale set to Japanese, I get
C:\Users\
ghc-pkg.EXE: <stdout>: commitBuffer: invalid argument (invalid character)


Is that the same for you?
GHC should work under the Japanese locale usually...
> stack exec ghc -- --version
The Glorious Glasgow Haskell Compilation System, version 8.2.2


Hmmm... You might have got a bug of GHC...?:confused:
@igrep I'm also not sure what's going on, I just installed it with the stack installer https://www.stackage.org/stack/windows-x86_64-installer
@igrep just to double check, for me it fails when I have both the Japanese locale and a Japanese user name, do you think this combination should work?
because that funny newline split is exactly where the user name should be
@nh2 Oh, yeah, it can be related.
Because GHC installed via stack is usually installed under %LOCALAPPDATA%.
E.g.
> stack exec which ghc
/c/Users/Yuji/AppData/Local/Programs/stack/x86_64-windows/ghc-8.2.2/bin/ghc

We know we should avoid making %USERPROFILE% contain Japanese name, which causes some errors.
@igrep Is that also written down / documented somewhere? I would like to know more about it, maybe I can even fix it
Hmmm... Sorry, I don't know the detail. Maybe we're too accustomed to avoid Japanese characters before fixing it... :disappointed_relieved:

まだ投票していないという方はお急ぎください！