[racket] Problem around Creating Excutables

From: 亀田馬志 (masashi.kameda at gmail.com)
Date: Thu Jan 2 10:09:06 EST 2014

Oh, Thanx. I see, now it works!

------

#lang racket

(current-output-port
 (reencode-output-port (current-output-port) "shift_jis"))

(display "あ")
(flush-output)

------

Yeah, for Japanese people using Windows, the word "SHIFT-JIS' is so
familiar; but strangely, it didn't pop up in my mind.... (I tried putting
'windows-932', since chcp command told me so, several times, and I was
being upset) (^^ ;

Now having "mojibake" solved.

Here are two questions.

I'm trying making a game with REPL structure, or similar to an interpreter.
I guessed, according to the code above and the discussion shown in:

https://groups.google.com/forum/#!topic/racket-users/MGDUNnUVzWU

, I have to put '(flush-output)' here in like this:

------

(define (read ....))

(define (eval ...
    ....
    ;;; pseudo
    (cond ((you want exit?)
              (flush-output) (exit))
             (else (continue-game))

    ...)

(define (print ...))


------

Is this O.K? or do I have to put (flush-output) every time after (display)?

The second question is... The game I compiled is, after shown several
processes I made, got Abend, though running on Racket Interpreter is fine.
What is the reason of this? Do I have to put something like
(current-input-port)
 stuff?

Thanx





2014/1/2 Pierpaolo Bernardi <olopierpa at gmail.com>

> On Thu, Jan 2, 2014 at 1:05 AM, 亀田馬志 <masashi.kameda at gmail.com> wrote:
>
> > Does anybody know how to tell Racket's compiler "I wanna see this in
> UTF-8"?
>
> Are you sure that your DOS windows is using UTF-8?
> AFAIK if you do nothing racket sends UTF-8 to the console.
>
> Maybe your console is not using UTF-8.  If this is the case you may:
>
> - use the Racket reencode-output-port function to reencode the output
> stream to whatever encoding your console is using, or
>
> - use the dos CHCP command to switch the console to use UTF-8.
>
> In this thread of some time ago you can read a previous discussion
> about this problem with some hints:
> https://groups.google.com/forum/#!topic/racket-users/MGDUNnUVzWU
>
> HTH
> P.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20140103/c8c44208/attachment-0001.html>

Posted on the users mailing list.