My favorites | Sign in
Project Home Downloads Wiki Issues Source
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 757: Econding problem in Windows.
4 people starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  div...@gmail.com
Closed:  Jan 2013


Sign in to add a comment
 
Reported by kurbat...@gmail.com, Nov 17, 2012
Default console output in windows is not utf8. So in interaction mode agda fails to write some characters.

Localy i fixed it by setting encoding in mimicGHCi.

mimicGHCi :: TCM ()
mimicGHCi = do

    liftIO $ hSetBuffering stdout NoBuffering
    liftIO $ hSetEncoding stdout utf8
Nov 17, 2012
Project Member #1 andreas....@gmail.com
(No comment was entered for this change.)
Cc: div...@gmail.com
Labels: Type-Defect OpSys-Windows
Nov 17, 2012
Project Member #2 div...@gmail.com
Unfortunately I have no Windows to test this (last time I installed Agda on Windows but for students only).

Nov 19, 2012
Project Member #3 nils.anders.danielsson
We should definitely use the UTF-8 character encoding when
communicating with Emacs (on all systems). I think we explicitly chose
UTF-8 in the past, but things changed quite a lot between 2.3.0 and
2.3.2.

Note that the Emacs mode assumes that Agda uses UTF-8:

  (set-buffer-file-coding-system 'utf-8)
  (set-buffer-process-coding-system 'utf-8 'utf-8)

Owner: div...@gmail.com
Cc: -div...@gmail.com
Labels: Priority-High Milestone-2.3.4
Jan 18, 2013
#5 dag...@gmail.com
Edit: I really meant emacs24

I can confirm that `hSetEncoding stdout utf8` is needed on windows at the moment to communicate correctly with emacs24 (agda 2.3.2).

(I also set utf8 for stderr just to be safe)

In the process of debugging this I created this ticket for ghc that I think is related: http://hackage.haskell.org/trac/ghc/ticket/7593

Whatever emacs was doing to set the encoding was not enough for Agda to take the hint. The IO subsystem in the RTS was throwing an exception and agda wasn't catching it. The result was that anything that should be outputted with unicode was silently failing (the agda process would exit with exit code 1).

I looked around for ways to set the codepage in emacs to 65001, but as far as I can tell it doesn't exist. I am able to M-x shell, and then run chcp 65001 and then agda works (without the fix above).

For anyone trying to reproduce this, I found that it helps to set a global env var in windows, LANG=en_US.UTF-8.
Jan 18, 2013
#6 dag...@gmail.com
Here is a patch that gets agda building on ghc-7.6 and makes the utf-8 change for stdout.
bump-the-win32-version-requirement-for-ghc_7_6.dpatch
8.4 KB   View   Download
Jan 28, 2013
Project Member #7 nils.anders.danielsson
Pushed.
Status: Fixed
Mar 15, 2013
Project Member #8 nils.anders.danielsson
 Issue 820  has been merged into this issue.
Oct 30, 2013
Project Member #9 nils.anders.danielsson
(No comment was entered for this change.)
Labels: Emacs
Oct 30, 2013
Project Member #10 nils.anders.danielsson
 Issue 928  has been merged into this issue.
Sign in to add a comment

Powered by Google Project Hosting