unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Christopher Lam <christopher.lck@gmail.com>
To: Mark H Weaver <mhw@netris.org>
Cc: guile-user <guile-user@gnu.org>
Subject: Re: string-ports issue on Windows
Date: Thu, 18 Apr 2019 16:22:24 +0000	[thread overview]
Message-ID: <CAKVAZZ+v9kFaAUxeJ5_opNSnmwJONT+wW14R38AHGpnwqEfuGA@mail.gmail.com> (raw)
In-Reply-To: <87tvew4efa.fsf@netris.org>

Hi Mark
Thank you so much for looking into this.
I'm reviewing the GnuCash for Windows package (v3.5 released April 2019)
which contains the following libraries:
- guile 2.0.14
- libunistring 0.9.7.0
- libiconv 1.15.0.0
I've managed to run the included guile.exe -- copied the libraries to
%temp%\lib and adding that to GUILE_LOAD_PATH
Here's the equivalent transcript, run from Windows 10 Command Prompt
--8<---------------cut here---------------end--------------->8---
scheme@(guile-user)> (define lira #\x20BA)
scheme@(guile-user)> lira
$3 = #\20272
scheme@(guile-user)> (string lira)
$4 = "\u20ba"
scheme@(guile-user)> (define lira #\x20BA)
scheme@(guile-user)> lira
$5 = #\20272
scheme@(guile-user)> (string lira)
$6 = "\u20ba"
scheme@(guile-user)> (call-with-output-string
                       (lambda (port) (display lira port)))
$7 = "?"
scheme@(guile-user)> (call-with-output-string
                       (lambda (port) (display (string lira) port)))
$8 = "?"
scheme@(guile-user)> (locale-encoding)
$9 = "CP1252"
...
scheme@(guile-user)> (setlocale LC_ALL "")
$15 = "English_Australia.1252"
scheme@(guile-user)> (locale-encoding)
$16 = "CP1252"
scheme@(guile-user)> (setlocale LC_ALL "C")
$17 = "C"
scheme@(guile-user)> (locale-encoding)
$18 = "CP1252"
--8<---------------cut here---------------end--------------->8---


On Wed, 17 Apr 2019 at 19:32, Mark H Weaver <mhw@netris.org> wrote:

> 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-18 16:22 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
2019-04-18 16:22       ` Christopher Lam [this message]
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=CAKVAZZ+v9kFaAUxeJ5_opNSnmwJONT+wW14R38AHGpnwqEfuGA@mail.gmail.com \
    --to=christopher.lck@gmail.com \
    --cc=guile-user@gnu.org \
    --cc=mhw@netris.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).