[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: displaying UTF8 characters in and out of a script (guile 2.0.5)
From: |
David Pirotte |
Subject: |
Re: displaying UTF8 characters in and out of a script (guile 2.0.5) |
Date: |
Sun, 16 Dec 2012 18:04:52 -0200 |
Hello,
> However, the same command in a script:
>
> #!/usr/bin/guile \
> -s
> #!
> (display "Ćićolina")
>
> writes this out: ?i?olina
you need to set the port encoding first [for further info see section '6.14.1
Ports'
of the manual]:
#!/bin/sh
# -*- mode: scheme; coding: utf-8 -*-
exec guile -e main -s $0 "$@"
!#
(define (main args)
(let ((port (current-output-port)))
(set-port-encoding! port "utf-8")
(display "Ćićolina\n" port)))
Cheers,
David