<div dir="ltr">Oh, Thanx. I see, now it works!<div><br></div><div>------</div><div><br></div><div><div>#lang racket</div><div><br></div><div>(current-output-port </div><div> (reencode-output-port (current-output-port) "shift_jis"))</div>
<div><br></div><div>(display "$B$"(B")</div><div>(flush-output)</div></div><div><br></div><div>------</div><div><br></div><div>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) (^^ ;</div>
<div><br></div><div>Now having "mojibake" solved.</div><div><br></div><div>Here are two questions.</div><div><br></div><div>I'm trying making a game with REPL structure, or similar to an interpreter.</div><div>
I guessed, according to the code above and the discussion shown in:</div><div><br></div><div><a href="https://groups.google.com/forum/#!topic/racket-users/MGDUNnUVzWU" target="_blank" style="font-family:arial,sans-serif;font-size:14px">https://groups.google.com/forum/#!topic/racket-users/MGDUNnUVzWU</a><br>
</div><div><br></div><div>, I have to put '<span style="font-family:Arial,Helvetica,sans-serif;font-size:13px">(flush-output)' here in like this:</span></div><div><span style="font-family:Arial,Helvetica,sans-serif;font-size:13px"><br>
</span></div><div><span style="font-family:Arial,Helvetica,sans-serif;font-size:13px">------</span></div><div><span style="font-family:Arial,Helvetica,sans-serif;font-size:13px"><br></span></div><div><font face="Arial, Helvetica, sans-serif">(define (read ....))</font></div>
<div><font face="Arial, Helvetica, sans-serif"><br></font></div><div><font face="Arial, Helvetica, sans-serif">(define (eval ...</font></div><div><font face="Arial, Helvetica, sans-serif">    ....</font></div><div><font face="Arial, Helvetica, sans-serif">    ;;; pseudo</font></div>
<div><font face="Arial, Helvetica, sans-serif">    (cond ((you want exit?)</font></div><div><font face="Arial, Helvetica, sans-serif">              (flush-output) (exit))</font></div><div><font face="Arial, Helvetica, sans-serif">             (else (continue-game))</font></div>
<div><font face="Arial, Helvetica, sans-serif"><br></font></div><div><font face="Arial, Helvetica, sans-serif">    ...)</font></div><div><font face="Arial, Helvetica, sans-serif"><br></font></div><div><font face="Arial, Helvetica, sans-serif">(define (print ...))</font></div>
<div><font face="Arial, Helvetica, sans-serif"><br></font></div><div><font face="Arial, Helvetica, sans-serif"><br></font></div><div><font face="Arial, Helvetica, sans-serif">------</font></div><div><font face="Arial, Helvetica, sans-serif"><br>
</font></div><div><font face="Arial, Helvetica, sans-serif">Is this O.K? or do I have to put (flush-output) every time after (display)?</font></div><div><font face="Arial, Helvetica, sans-serif"><br></font></div><div><font face="Arial, Helvetica, sans-serif">The second question is... The game I compiled is, after shown several processes I made, got Abend, though running on Racket Interpreter is fine.</font></div>
<div><font face="Arial, Helvetica, sans-serif">What is the reason of this? Do I have to put something like (current-input-port)</font></div><div><font face="Arial, Helvetica, sans-serif"> stuff?</font></div><div><font face="Arial, Helvetica, sans-serif"><br>
</font></div><div><font face="Arial, Helvetica, sans-serif">Thanx</font></div><div><font face="Arial, Helvetica, sans-serif">        </font></div><div><font face="Arial, Helvetica, sans-serif"><br></font></div><div><font face="Arial, Helvetica, sans-serif"><br>
</font></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014/1/2 Pierpaolo Bernardi <span dir="ltr"><<a href="mailto:olopierpa@gmail.com" target="_blank">olopierpa@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Thu, Jan 2, 2014 at 1:05 AM, $B55EDGO;V(B <<a href="mailto:masashi.kameda@gmail.com">masashi.kameda@gmail.com</a>> wrote:<br>
<br>
> Does anybody know how to tell Racket's compiler "I wanna see this in UTF-8"?<br>
<br>
</div>Are you sure that your DOS windows is using UTF-8?<br>
AFAIK if you do nothing racket sends UTF-8 to the console.<br>
<br>
Maybe your console is not using UTF-8.  If this is the case you may:<br>
<br>
- use the Racket reencode-output-port function to reencode the output<br>
stream to whatever encoding your console is using, or<br>
<br>
- use the dos CHCP command to switch the console to use UTF-8.<br>
<br>
In this thread of some time ago you can read a previous discussion<br>
about this problem with some hints:<br>
<a href="https://groups.google.com/forum/#!topic/racket-users/MGDUNnUVzWU" target="_blank">https://groups.google.com/forum/#!topic/racket-users/MGDUNnUVzWU</a><br>
<br>
HTH<br>
<span class="HOEnZb"><font color="#888888">P.<br>
</font></span></blockquote></div><br></div>