Re: [Rd] Sys.getenv(): Error in substring(x, m + 1L) : invalid multibyte string at '' if an environment variable contains \xFF

2023-01-31 Thread Ivan Krylov
Can we use the "bytes" encoding for such environment variables invalid in the current locale? The following patch preserves CE_NATIVE for strings valid in the current UTF-8 or multibyte locale (or non-multibyte strings) but sets CE_BYTES for those that are invalid: Index: src/main/sysutils.c =

Re: [Rd] Sys.getenv(): Error in substring(x, m + 1L) : invalid multibyte string at '' if an environment variable contains \xFF

2023-01-31 Thread Tomas Kalibera
On 1/31/23 01:27, Simon Urbanek wrote: Tomas, I think you're not addressing the actual issue which is a clear regression in Sys.getenv() [because it used to work and still works for single env var, but not a list] and the cryptic error due to that regression (caused by changes in R-devel). So

Re: [Rd] Sys.getenv(): Error in substring(x, m + 1L) : invalid multibyte string at '' if an environment variable contains \xFF

2023-01-31 Thread Tomas Kalibera
On 1/31/23 09:48, Ivan Krylov wrote: Can we use the "bytes" encoding for such environment variables invalid in the current locale? The following patch preserves CE_NATIVE for strings valid in the current UTF-8 or multibyte locale (or non-multibyte strings) but sets CE_BYTES for those that are i

Re: [Rd] Sys.getenv(): Error in substring(x, m + 1L) : invalid multibyte string at '' if an environment variable contains \xFF

2023-01-31 Thread Martin Maechler
> Tomas Kalibera > on Tue, 31 Jan 2023 10:53:21 +0100 writes: > On 1/31/23 09:48, Ivan Krylov wrote: >> Can we use the "bytes" encoding for such environment variables invalid >> in the current locale? The following patch preserves CE_NATIVE for >> strings valid in the

Re: [Rd] Sys.getenv(): Error in substring(x, m + 1L) : invalid multibyte string at '' if an environment variable contains \xFF

2023-01-31 Thread Duncan Murdoch
On 31/01/2023 5:50 a.m., Martin Maechler wrote: Tomas Kalibera on Tue, 31 Jan 2023 10:53:21 +0100 writes: > On 1/31/23 09:48, Ivan Krylov wrote: >> Can we use the "bytes" encoding for such environment variables invalid >> in the current locale? The following patch preserves

Re: [Rd] Sys.getenv(): Error in substring(x, m + 1L) : invalid multibyte string at '' if an environment variable contains \xFF

2023-01-31 Thread Tomas Kalibera
On 1/31/23 11:50, Martin Maechler wrote: Tomas Kalibera on Tue, 31 Jan 2023 10:53:21 +0100 writes: > On 1/31/23 09:48, Ivan Krylov wrote: >> Can we use the "bytes" encoding for such environment variables invalid >> in the current locale? The following patch preserves CE_NAT

Re: [Rd] Sys.getenv(): Error in substring(x, m + 1L) : invalid multibyte string at '' if an environment variable contains \xFF

2023-01-31 Thread peter dalgaard
> On 31 Jan 2023, at 12:51 , Tomas Kalibera wrote: > > > On 1/31/23 11:50, Martin Maechler wrote: >> hmm.., that's a pity; I had hoped it was a pragmatic and valid strategy, >> but of course you are right that type stability is really a >> valid goal >> >> In general, what about behavin

Re: [Rd] Sys.getenv(): Error in substring(x, m + 1L) : invalid multibyte string at '' if an environment variable contains \xFF

2023-01-31 Thread Tomas Kalibera
On 1/31/23 14:37, peter dalgaard wrote: On 31 Jan 2023, at 12:51 , Tomas Kalibera wrote: On 1/31/23 11:50, Martin Maechler wrote: hmm.., that's a pity; I had hoped it was a pragmatic and valid strategy, but of course you are right that type stability is really a valid goal In gener