[R-SIG-Mac] Bug related to locale changes.

Rainer M Krug Rainer at krugs.de
Mon Jun 8 15:07:47 CEST 2015


Simon Urbanek <simon.urbanek at r-project.org> writes:

> Interesting - it seems to fail only the first time after the locale is set:
>
>> Sys.setlocale(locale="en_CA")
> [1] "en_CA/en_CA/en_CA/C/en_CA/en_US.UTF-8"
>> "320" > "300"
> [1] NA
>> "320" > "300"
> [1] TRUE
>> "320" > "300"
> [1] TRUE
>
> There is probably an associated error. I'll have a look later today unless someone beats me to it.

Some more datapoints to this:

,----
| > Sys.getlocale()
| [1] "en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8"
| > Sys.setlocale(locale="en_US")
| [1] "en_US/en_US/en_US/C/en_US/en_US.UTF-8"
| > "320" > "300"
| [1] NA
| > Sys.setlocale(locale="en_US")
| [1] "en_US/en_US/en_US/C/en_US/en_US.UTF-8"
| > "320" > "300"
| [1] TRUE
| > Sys.getlocale()
| [1] "en_US/en_US/en_US/C/en_US/en_US.UTF-8"
| > "320" > "300"
| [1] TRUE
| > Sys.setlocale(locale="en_CA")
| [1] "en_CA/en_CA/en_CA/C/en_CA/en_US.UTF-8"
| > "320" > "300"
| [1] NA
| > "320" > "300"
| [1] TRUE
| > Sys.getlocale()
| [1] "en_CA/en_CA/en_CA/C/en_CA/en_US.UTF-8"
| > Sys.setlocale(locale="en_US")
| [1] "en_US/en_US/en_US/C/en_US/en_US.UTF-8"
| > "320" > "300"
| [1] TRUE
| > Sys.setlocale(locale="en_CA")
| [1] "en_CA/en_CA/en_CA/C/en_CA/en_US.UTF-8"
| > "320" > "300"
| [1] TRUE
`----

Even when I set the locale to the same it is, I observe this error.

Rainer


>
> Thanks,
> Simon
>
>
> On Jun 8, 2015, at 7:40 AM, Duncan Murdoch <murdoch.duncan at gmail.com> wrote:
>
>> I posted this to R-devel yesterday; from responses received, it appears
>> to be OSX-specific (maybe Mavericks-specific).
>> 
>> In an R session started from the terminal with R --vanilla, I see this:
>> 
>>> Sys.setlocale(locale="en_CA")
>> [1] "en_CA/en_CA/en_CA/C/en_CA/en_CA.UTF-8"
>>> "320" > "300"
>> [1] NA
>>> "320" > "300"
>> [1] TRUE
>> 
>> The first string comparison after the locale change produces NA, while
>> later ones are fine.
>> 
>> The locale string "en_CA" doesn't appear to matter, as long as it is
>> different from my previous locale.
>> 
>> Do others see this?  Can we fix it before the 3.2.1 release?
>> 
>> Duncan Murdoch
>> 
>> _______________________________________________
>> R-SIG-Mac mailing list
>> R-SIG-Mac at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>> 

-- 
Rainer M. Krug
email: Rainer<at>krugs<dot>de
PGP: 0x0F52F982
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 494 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-mac/attachments/20150608/3245bb0a/attachment.bin>


More information about the R-SIG-Mac mailing list