unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Mark H Weaver <mhw@netris.org>
To: ludo@gnu.org (Ludovic Courtès)
Cc: 11197@debbugs.gnu.org, Klaus Stehle <klaus.stehle@uni-tuebingen.de>
Subject: bug#11197: problems with string ports and unicode
Date: Wed, 11 Apr 2012 12:08:09 -0400	[thread overview]
Message-ID: <87ty0q8d5h.fsf@netris.org> (raw)
In-Reply-To: <87ty0sa9tu.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Mon, 09 Apr 2012 23:12:29 +0200")

ludo@gnu.org (Ludovic Courtès) writes:
> It may be that your string ports are created with a non-Unicode-capable
> encoding.  Try something like:
>
>   (define p
>     (with-fluids ((%default-port-encoding "UTF-8"))
>       (open-input-string "čtyří")))

IMO, this should not be needed.  Port encodings should only be relevant
when reading from ports involving byte strings, such as file ports or
socket ports.  The encoding used by Scheme strings is a purely internal
matter; from the user's perspective, Scheme strings are simply a
sequence of Unicode code points.

What _is_ needed is a file coding declaration near the top of the source
file, e.g. "coding: utf-8" (see "Character Encoding of Source Files" in
the manual).  I tried that and it still fails for me.

I think this is a genuine bug.

     Mark





  reply	other threads:[~2012-04-11 16:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-07 20:07 bug#11197: problems with string ports and unicode Klaus Stehle
2012-04-09 21:12 ` Ludovic Courtès
2012-04-11 16:08   ` Mark H Weaver [this message]
2012-04-11 16:25     ` Ludovic Courtès
2012-04-11 17:53       ` Mark H Weaver
2012-04-11 21:01         ` Ludovic Courtès
2012-06-20 20:58           ` Ludovic Courtès
2012-06-20 21:03           ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ty0q8d5h.fsf@netris.org \
    --to=mhw@netris.org \
    --cc=11197@debbugs.gnu.org \
    --cc=klaus.stehle@uni-tuebingen.de \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).