haskell-jp / general #6

@igrep pinned a message to this channel.
回答期間は、約2週間後の4月11日 08:00までです。
@yuuki.1226.saito has joined the channel
@andes has joined the channel
@agenda21st_slack has joined the channel
@rustofau has joined the channel
@shohei.takaichi has joined the channel
@mail has joined the channel
hi, are there any Japanese Haskell users with Windows around that could try
import GHC.IO.Encoding

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
Loaded GHCi configuration from C:\Users\igrep\Dropbox\dot-files\dot-files\.ghci
> import GHC.IO.Encoding
[Prelude GHC.IO.Encoding]
> getForeignEncoding
@service 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.
Open Windows Control Panel
Select Region and Language
Click on the Administrative tab
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.
If your error is similar to one referred in https://haskell.jp/blog/posts/2017/windows-gotchas.html, codes in the article would help you.
(Sorry, this is not translated into English yet...)
こちらですが残り一週間を切りました。大分集まったようですがまだまだ投票は受け付けているので是非! hask(_ _)eller

@s.hayashi.py has joined the channel
@pan.live has joined the channel
@htilcs1115 has joined the channel
@igrep @yharuhi39 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
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
@mail Oh, yeah, it can be related.
Because GHC installed via stack is usually installed under %LOCALAPPDATA%.
> stack exec which 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:
@igrep no worries, knowing that this is a known problem already helps a lot, so I know it isn't a fault of my setup
@h.hata.ai.t has joined the channel
こんにちは、はじめましてXmonadからHaskellに入ってきました、よろしくお願いします :pray:
@igrep uploaded a file: 第1回 Haskell jp 新ロゴ選挙 結果.png and commented: !here 第1回Haskell-jp 新ロゴ選挙、投票受付を完了しました。
A案に決定です!作成した @fumievalさんありがとうございました!
@katsushi.kagaya has joined the channel
@zeroinon1206bass has joined the channel
@maeken2010 has joined the channel
@kawarusosu has joined the channel
@hansel.no.kioku has joined the channel
@akirakawata1 has joined the channel