[racket] current-output encoding

From: Pierpaolo Bernardi (olopierpa at gmail.com)
Date: Tue Mar 26 13:29:00 EDT 2013

On Tue, Mar 26, 2013 at 5:25 PM, Pierpaolo Bernardi <olopierpa at gmail.com> wrote:
> On Tue, Mar 26, 2013 at 5:00 PM, Matthew Flatt <mflatt at cs.utah.edu> wrote:
>
>> I think you want `reencode-output-port', probably using "" (which
>> represents the user's default encoding) as the target encoding.
>
> I tried the following:
>
> ====
> #lang racket
>
> (current-output-port (reencode-output-port (current-output-port) ""))
>
> (display "à")
> ====
>
> but this displays nothing both in DrRacket and in the console.
> Also "program >tempfile" from the console produces a file of length 0.

Adding a (flush-output) after the display makes it work from inside DrRacket.

In the console there's no change, and redirecting the output to a file
still produces a 0-length file, though.


Posted on the users mailing list.