unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Mark H Weaver <mhw@netris.org>
To: Christopher Lam <christopher.lck@gmail.com>
Cc: guile-user <guile-user@gnu.org>
Subject: Re: string-ports issue on Windows
Date: Wed, 17 Apr 2019 15:30:38 -0400	[thread overview]
Message-ID: <87tvew4efa.fsf@netris.org> (raw)
In-Reply-To: <CAKVAZZLTL1+AJCkQ0t8VbdS=39BxLG5=T7TD+C0_2_7-kPuY0g@mail.gmail.com> (Christopher Lam's message of "Tue, 16 Apr 2019 23:26:49 +0000")

Hi Christopher,

Christopher Lam <christopher.lck@gmail.com> writes:

> Bearing in mind majority of strings code in GnuCash handle Unicode just
> fine. However, there are some currencies e.g.TYR
> https://en.wikipedia.org/wiki/Turkish_lira need extended Unicode and are
> misprinted as ? in the reports.

I looked into Turkish lira, which according to the web page above was
recently (2012) assigned the Unicode code point U+20BA, included in
Unicode 6.2.  As that the same code point that's getting munged on your
end?

I tried passing this character through Guile 2.2's string ports and also
through 'format' on my system, and encountered no difficulties:

--8<---------------cut here---------------start------------->8---
mhw@jojen ~/guile-stable-2.2$ guile
GNU Guile 2.2.4
Copyright (C) 1995-2017 Free Software Foundation, Inc.

Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.

Enter `,help' for help.
scheme@(guile-user)> (define lira #\x20BA)
scheme@(guile-user)> lira
$1 = #\₺
scheme@(guile-user)> (string lira)
$2 = "₺"
scheme@(guile-user)> (call-with-output-string
                       (lambda (port) (display lira port)))
$3 = "₺"
scheme@(guile-user)> (call-with-output-string
                       (lambda (port) (display (string lira) port)))
$4 = "₺"
scheme@(guile-user)> (call-with-input-string (string lira) read-char)
$5 = #\₺
scheme@(guile-user)> (call-with-input-string (string lira) read)
$6 = ₺
scheme@(guile-user)> ,use (ice-9 rdelim)
scheme@(guile-user)> (call-with-input-string (string lira) read-line)
$7 = "₺"
scheme@(guile-user)> (number->string (char->integer (call-with-input-string (string lira) read-char)) 16)
$8 = "20ba"
scheme@(guile-user)> (format #f "~a bla" lira)
$9 = "₺ bla"
scheme@(guile-user)> (format #f "~a bla" (string lira))
$10 = "₺ bla"
scheme@(guile-user)> ,use (ice-9 format)
scheme@(guile-user)> (format #f "~a bla" lira)
$11 = "₺ bla"
scheme@(guile-user)> (format #f "~a bla" (string lira))
$12 = "₺ bla"
scheme@(guile-user)> (simple-format #f "~a bla" lira)
$13 = "₺ bla"
scheme@(guile-user)> (simple-format #f "~a bla" (string lira))
$14 = "₺ bla"
scheme@(guile-user)> 
--8<---------------cut here---------------end--------------->8---

I'm not sure if you'll see it correctly in your mail client, but in the
above transcript, I see unmunged Turkish liras in every response from
Guile except $8.

If you type the same commands above into a fresh Guile session on your
system, does it behave correctly, or are the results munged?

If you're able to produce a small self-contained example that
demonstrates the problem, e.g. something along the lines of the
transcript above but which misbehaves on your system, that would be very
helpful.

Also, can you tell me precisely which version of Guile is misbehaving,
and what versions of libunistring and/or iconv is Guile linked with?

      Thanks,
        Mark



  reply	other threads:[~2019-04-17 19:30 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-16  4:13 string-ports issue on Windows Christopher Lam
2019-04-16 14:34 ` Eli Zaretskii
2019-04-16 17:15   ` Mark H Weaver
2019-04-16 17:28 ` Mark H Weaver
2019-04-16 23:26   ` Christopher Lam
2019-04-17 19:30     ` Mark H Weaver [this message]
2019-04-18 16:22       ` Christopher Lam
2019-04-18 18:51         ` Eli Zaretskii
2019-04-18 19:29         ` Mark H Weaver
2019-04-18 21:18           ` Mark H Weaver
2019-04-19 10:26             ` Christopher Lam
2019-05-14  4:42               ` Christopher Lam
2019-05-26 10:52                 ` Christopher Lam
2019-05-26 20:48                   ` Mark H Weaver

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=87tvew4efa.fsf@netris.org \
    --to=mhw@netris.org \
    --cc=christopher.lck@gmail.com \
    --cc=guile-user@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).