[Top][All Lists]

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

bug#20822: environment mangled by locale

From: Andy Wingo
Subject: bug#20822: environment mangled by locale
Date: Fri, 24 Jun 2016 07:57:43 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

On Tue 16 Jun 2015 06:17, Zefram <address@hidden> writes:

> When guile-2.0 is asked to read environment variables, via getenv,
> it always decodes the underlying octet string according to the current
> locale's nominal character encoding.  This is a problem, because the
> environment variable's value is not necessarily encoded that way, and
> may not even be an encoding of a character string at all.  The decoding
> is lossy, where the octet string isn't consistent with the character
> encoding, so the original octet string cannot be recovered from the
> mangled form.  I don't see any Scheme interface that retrieves the
> environment without locale decoding.


  Add optional "encoding" arg to scm_getenv; encoding is a string

  Add alternate getenv interface that returns a bytevector

We'll have to do the same for setenv too, I think.

I think I would go with adding an encoding argument to getenv.  WDYT
Mark and Ludovic?


reply via email to

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