unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#23754: Guile doesn't show correct character while interpreting script file
@ 2016-06-12  9:17 Ws Hu
  2016-07-11  8:06 ` Alex Kost
  0 siblings, 1 reply; 3+ messages in thread
From: Ws Hu @ 2016-06-12  9:17 UTC (permalink / raw)
  To: 23754

[-- Attachment #1: Type: text/plain, Size: 1191 bytes --]

Hi,

guile replaces non-ascii unicodes with question marks while interpreting
script file:

> $ cat test.scm
> (display "蛤")
> $ file test.scm
> test.scm: UTF-8 Unicode text
> $ guile test.scm
> ?


while it works fine in REPL mode:

> $ guile <<<'(display "蛤")'
> GNU Guile 2.0.11
> Copyright (C) 1995-2014 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.
> 蛤


and I think it's not a problem of my locale configuration:

> $ locale
> LANG=en_US.UTF-8
> LC_CTYPE="en_US.UTF-8"
> LC_NUMERIC="en_US.UTF-8"
> LC_TIME="en_US.UTF-8"
> LC_COLLATE="en_US.UTF-8"
> LC_MONETARY="en_US.UTF-8"
> LC_MESSAGES="en_US.UTF-8"
> LC_PAPER="en_US.UTF-8"
> LC_NAME="en_US.UTF-8"
> LC_ADDRESS="en_US.UTF-8"
> LC_TELEPHONE="en_US.UTF-8"
> LC_MEASUREMENT="en_US.UTF-8"
> LC_IDENTIFICATION="en_US.UTF-8"
> LC_ALL=

because my terminal recognizes utf8 bytes:

> $ printf "\xe8\x9b\xa4"
> 蛤

where e8-9b-a4 is the utf8-encoded Chinese character "蛤"

[-- Attachment #2: Type: text/html, Size: 2213 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#23754: Guile doesn't show correct character while interpreting script file
  2016-06-12  9:17 bug#23754: Guile doesn't show correct character while interpreting script file Ws Hu
@ 2016-07-11  8:06 ` Alex Kost
  2016-07-11 16:20   ` Andy Wingo
  0 siblings, 1 reply; 3+ messages in thread
From: Alex Kost @ 2016-07-11  8:06 UTC (permalink / raw)
  To: Ws Hu; +Cc: 23754

Ws Hu (2016-06-12 12:17 +0300) wrote:

> Hi,
>
> guile replaces non-ascii unicodes with question marks while
> interpreting script file:
>
>     $ cat test.scm
>     (display "蛤")
>     $ file test.scm
>     test.scm: UTF-8 Unicode text
>     $ guile test.scm
>     ?

Hi, putting (setlocale LC_ALL "") in the beginning of "test.scm" should
fix it.

-- 
Alex





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#23754: Guile doesn't show correct character while interpreting script file
  2016-07-11  8:06 ` Alex Kost
@ 2016-07-11 16:20   ` Andy Wingo
  0 siblings, 0 replies; 3+ messages in thread
From: Andy Wingo @ 2016-07-11 16:20 UTC (permalink / raw)
  To: Alex Kost; +Cc: 23754-done, Ws Hu

On Mon 11 Jul 2016 10:06, Alex Kost <alezost@gmail.com> writes:

> Ws Hu (2016-06-12 12:17 +0300) wrote:
>
>> Hi,
>>
>> guile replaces non-ascii unicodes with question marks while
>> interpreting script file:
>>
>>     $ cat test.scm
>>     (display "蛤")
>>     $ file test.scm
>>     test.scm: UTF-8 Unicode text
>>     $ guile test.scm
>>     ?
>
> Hi, putting (setlocale LC_ALL "") in the beginning of "test.scm" should
> fix it.

Note that this is fixed in the 2.2 beta releases.  See the discussion in
https://www.gnu.org/software/guile/manual/html_node/Environment-Variables.html#Environment-Variables
(part of the 2.0 manual) for more on GUILE_INSTALL_LOCALE.

Unfortunately there is still a bug in GUILE_INSTALL_LOCALE=1 in most
versions of Guile 2.0 where Guile will install the locale, but not use
its charset for the default encoding :(  Fixed in 2.2 beta releases, and
will be fixed in 2.0.12.

Andy





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-07-11 16:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-12  9:17 bug#23754: Guile doesn't show correct character while interpreting script file Ws Hu
2016-07-11  8:06 ` Alex Kost
2016-07-11 16:20   ` Andy Wingo

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).