guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: string-ports issue on Windows


From: Christopher Lam
Subject: Re: string-ports issue on Windows
Date: Thu, 18 Apr 2019 16:22:24 +0000

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 <address@hidden> wrote:

> Hi Christopher,
>
> Christopher Lam <address@hidden> 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---
> address@hidden ~/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 via email to

[Prev in Thread] Current Thread [Next in Thread]