unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Linas Vepstas <linasvepstas@gmail.com>
To: 25397@debbugs.gnu.org
Subject: bug#25397: guile-2.2 regression in utf8 support in scm_puts scm_lfwrite scm_c_put_string
Date: Sun, 8 Jan 2017 12:16:23 -0600	[thread overview]
Message-ID: <CAHrUA35wPNE0JgCDonQTk_z=ZNijWJWzKHzu+pdSMYF-3-1_zg@mail.gmail.com> (raw)

There appears to be a regression in guile-2.2 with utf8 handling
in the scm_puts() scm_lfwrite() and scm_c_put_string() functions.

In guile-2.0, one could give these utf8-encoded strings, and these
would display just fine.  In 2.2 they get mangled.

The source of the mangling seems to be an assumption that these
three are being given latin1 strings, which they then attempt to
convert to utf8, thus wrecking the encoding.  See, e.g. libguile/ports.c
line 3526

Presumably this change was intentional, but I don't understand
why; guile-2.0 seems utf-8 clean, correctly handling utf-8 in
essentially all cases.  Why would one want to go back to the
bad old days of latin1 and iso-8859-1 for guile 2.2?

I could submit a patch for this, but would it be wanted?

Test case is straight-forward:

printf("duuude port-encoding is=%s\n",
   scm_to_utf8_string(scm_port_encoding(scm_current_output_port ())));
scm_puts ("係 拉 丁 字 母", scm_current_output_port ());

which works in guile-2.0 but is garbled in 2.2





             reply	other threads:[~2017-01-08 18:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-08 18:16 Linas Vepstas [this message]
2017-01-09 22:03 ` bug#25397: guile-2.2 regression in utf8 support in scm_puts scm_lfwrite scm_c_put_string Andy Wingo
2017-01-10  3:34   ` Linas Vepstas
2017-03-01 15:45     ` Andy Wingo
2017-03-01 20:18       ` Linas Vepstas

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='CAHrUA35wPNE0JgCDonQTk_z=ZNijWJWzKHzu+pdSMYF-3-1_zg@mail.gmail.com' \
    --to=linasvepstas@gmail.com \
    --cc=25397@debbugs.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).