Help with setting locale

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Help with setting locale

Kim Titcombe
*Query or Set Aspects of the Locale*

 I have an issue with setting LOCALE in installation (new  installation on
new computer but have installed and used R before).

I am based in Switzerland but work in English (Windows in English), hence
want English as default.

Console contains following message:

# During startup - Warning message:

# Setting LC_CTYPE= failed

-------------------------------------------------

Solutions I tried found on “help” and in R manual as follows….

# Sys.getlocale(category = “LC_ALL”)

1]
"LC_COLLATE=English_Switzerland.65001;LC_CTYPE=C;LC_MONETARY=English_Switzerland.65001;LC_NUMERIC=C;LC_TIME=English_Switzerland.65001"

# Sys.setlocale(category=”LC_ALL”, locale = “ “)

or

# Sys.setlocale(category=”LC_ALL”, local=”Switzerland.65001”)

Output

# OS reports request to set locale to "Switzerland.65001" cannot be honoured

Tried various commands specific for 'LC_CTYPE' (as this is where
installation failed) for language string such as

# Sys.setlocale("LC_CTYPE","en-GB")

Output:

In Sys.setlocale("LC_CTYPE", "en-GB") :

  OS reports request to set locale to "en-GB" cannot be honoured

Would anyone have any further suggestions for correct command.

With thanks

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Help with setting locale

David Winsemius

> On Sep 14, 2018, at 1:02 AM, Kim Titcombe <[hidden email]> wrote:
>
> *Query or Set Aspects of the Locale*
>
> I have an issue with setting LOCALE in installation (new  installation on
> new computer but have installed and used R before).
>
> I am based in Switzerland but work in English (Windows in English), hence
> want English as default.
>
> Console contains following message:
>
> # During startup - Warning message:
>
> # Setting LC_CTYPE= failed
>
> -------------------------------------------------
>
> Solutions I tried found on “help” and in R manual as follows….
>
> # Sys.getlocale(category = “LC_ALL”)
>
> 1]
> "LC_COLLATE=English_Switzerland.65001;LC_CTYPE=C;LC_MONETARY=English_Switzerland.65001;LC_NUMERIC=C;LC_TIME=English_Switzerland.65001"
>
> # Sys.setlocale(category=”LC_ALL”, locale = “ “)
>
> or
>
> # Sys.setlocale(category=”LC_ALL”, local=”Switzerland.65001”)
>
> Output
>
> # OS reports request to set locale to "Switzerland.65001" cannot be honoured
>
> Tried various commands specific for 'LC_CTYPE' (as this is where
> installation failed) for language string such as
>
> # Sys.setlocale("LC_CTYPE","en-GB")

You may get better results with an underscore rather than a dash.

Try:

Sys.setlocale("LC_CTYPE","en_GB")



On my machine you can get the acceptable locale strings with:

locales <- system("locale -a", intern = TRUE)
locales[ grep("GB",locales) ]  # Just the GB strings
[1] "en_GB"            "en_GB.ISO8859-1"  "en_GB.ISO8859-15" "en_GB.US-ASCII"   "en_GB.UTF-8"      "zh_CN.GB18030"    "zh_CN.GB2312"    
[8] "zh_CN.GBK"      



>
> Output:
>
> In Sys.setlocale("LC_CTYPE", "en-GB") :
>
>  OS reports request to set locale to "en-GB" cannot be honoured
>
> Would anyone have any further suggestions for correct command.
>
> With thanks
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

David Winsemius
Alameda, CA, USA

'Any technology distinguishable from magic is insufficiently advanced.'   -Gehm's Corollary to Clarke's Third Law

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Help with setting locale

David Winsemius

> On Sep 14, 2018, at 8:44 AM, David Winsemius <[hidden email]> wrote:
>
>
>> On Sep 14, 2018, at 1:02 AM, Kim Titcombe <[hidden email]> wrote:
>>
>> *Query or Set Aspects of the Locale*
>>
>> I have an issue with setting LOCALE in installation (new  installation on
>> new computer but have installed and used R before).
>>
>> I am based in Switzerland but work in English (Windows in English), hence
>> want English as default.
>>
>> Console contains following message:
>>
>> # During startup - Warning message:
>>
>> # Setting LC_CTYPE= failed
>>
>> -------------------------------------------------
>>
>> Solutions I tried found on “help” and in R manual as follows….
>>
>> # Sys.getlocale(category = “LC_ALL”)
>>
>> 1]
>> "LC_COLLATE=English_Switzerland.65001;LC_CTYPE=C;LC_MONETARY=English_Switzerland.65001;LC_NUMERIC=C;LC_TIME=English_Switzerland.65001"
>>
>> # Sys.setlocale(category=”LC_ALL”, locale = “ “)
>>
>> or
>>
>> # Sys.setlocale(category=”LC_ALL”, local=”Switzerland.65001”)
>>
>> Output
>>
>> # OS reports request to set locale to "Switzerland.65001" cannot be honoured
>>
>> Tried various commands specific for 'LC_CTYPE' (as this is where
>> installation failed) for language string such as
>>
>> # Sys.setlocale("LC_CTYPE","en-GB")
>
> You may get better results with an underscore rather than a dash.
>
> Try:
>
> Sys.setlocale("LC_CTYPE","en_GB")
>
>
>
> On my machine you can get the acceptable locale strings with:
>
> locales <- system("locale -a", intern = TRUE)
> locales[ grep("GB",locales) ]  # Just the GB strings
> [1] "en_GB"            "en_GB.ISO8859-1"  "en_GB.ISO8859-15" "en_GB.US-ASCII"   "en_GB.UTF-8"      "zh_CN.GB18030"    "zh_CN.GB2312"    
> [8] "zh_CN.GBK"      

I should have admitted that I use a Mac. If you use Windoze, then consult the MS authorities for naming. Perhaps this page: https://docs.microsoft.com/en-us/windows/desktop/Intl/language-identifier-constants-and-strings , which suggests to me using 'UK' rather than 'GB' might be needed and 'ENGLISH' rather than 'en'.


>
>
>
>>
>> Output:
>>
>> In Sys.setlocale("LC_CTYPE", "en-GB") :
>>
>> OS reports request to set locale to "en-GB" cannot be honoured
>>
>> Would anyone have any further suggestions for correct command.
>>
>> With thanks
>>
>> [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>
> David Winsemius
> Alameda, CA, USA
>
> 'Any technology distinguishable from magic is insufficiently advanced.'   -Gehm's Corollary to Clarke's Third Law
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

David Winsemius
Alameda, CA, USA

'Any technology distinguishable from magic is insufficiently advanced.'   -Gehm's Corollary to Clarke's Third Law

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Help with setting locale

Kim Titcombe
Thanks for the tip!
Kim

On Fri, 14 Sep 2018, 17:51 David Winsemius, <[hidden email]> wrote:

>
> > On Sep 14, 2018, at 8:44 AM, David Winsemius <[hidden email]>
> wrote:
> >
> >
> >> On Sep 14, 2018, at 1:02 AM, Kim Titcombe <[hidden email]>
> wrote:
> >>
> >> *Query or Set Aspects of the Locale*
> >>
> >> I have an issue with setting LOCALE in installation (new  installation
> on
> >> new computer but have installed and used R before).
> >>
> >> I am based in Switzerland but work in English (Windows in English),
> hence
> >> want English as default.
> >>
> >> Console contains following message:
> >>
> >> # During startup - Warning message:
> >>
> >> # Setting LC_CTYPE= failed
> >>
> >> -------------------------------------------------
> >>
> >> Solutions I tried found on “help” and in R manual as follows….
> >>
> >> # Sys.getlocale(category = “LC_ALL”)
> >>
> >> 1]
> >>
> "LC_COLLATE=English_Switzerland.65001;LC_CTYPE=C;LC_MONETARY=English_Switzerland.65001;LC_NUMERIC=C;LC_TIME=English_Switzerland.65001"
> >>
> >> # Sys.setlocale(category=”LC_ALL”, locale = “ “)
> >>
> >> or
> >>
> >> # Sys.setlocale(category=”LC_ALL”, local=”Switzerland.65001”)
> >>
> >> Output
> >>
> >> # OS reports request to set locale to "Switzerland.65001" cannot be
> honoured
> >>
> >> Tried various commands specific for 'LC_CTYPE' (as this is where
> >> installation failed) for language string such as
> >>
> >> # Sys.setlocale("LC_CTYPE","en-GB")
> >
> > You may get better results with an underscore rather than a dash.
> >
> > Try:
> >
> > Sys.setlocale("LC_CTYPE","en_GB")
> >
> >
> >
> > On my machine you can get the acceptable locale strings with:
> >
> > locales <- system("locale -a", intern = TRUE)
> > locales[ grep("GB",locales) ]  # Just the GB strings
> > [1] "en_GB"            "en_GB.ISO8859-1"  "en_GB.ISO8859-15"
> "en_GB.US-ASCII"   "en_GB.UTF-8"      "zh_CN.GB18030"    "zh_CN.GB2312"
> > [8] "zh_CN.GBK"
>
> I should have admitted that I use a Mac. If you use Windoze, then consult
> the MS authorities for naming. Perhaps this page:
> https://docs.microsoft.com/en-us/windows/desktop/Intl/language-identifier-constants-and-strings
> , which suggests to me using 'UK' rather than 'GB' might be needed and
> 'ENGLISH' rather than 'en'.
>
>
> >
> >
> >
> >>
> >> Output:
> >>
> >> In Sys.setlocale("LC_CTYPE", "en-GB") :
> >>
> >> OS reports request to set locale to "en-GB" cannot be honoured
> >>
> >> Would anyone have any further suggestions for correct command.
> >>
> >> With thanks
> >>
> >>      [[alternative HTML version deleted]]
> >>
> >> ______________________________________________
> >> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> >> https://stat.ethz.ch/mailman/listinfo/r-help
> >> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> >> and provide commented, minimal, self-contained, reproducible code.
> >
> > David Winsemius
> > Alameda, CA, USA
> >
> > 'Any technology distinguishable from magic is insufficiently advanced.'
>  -Gehm's Corollary to Clarke's Third Law
> >
> > ______________________________________________
> > [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
>
> David Winsemius
> Alameda, CA, USA
>
> 'Any technology distinguishable from magic is insufficiently advanced.'
>  -Gehm's Corollary to Clarke's Third Law
>
>
>
>
>
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Help with setting locale

Ivan Krylov
In reply to this post by Kim Titcombe
On Fri, 14 Sep 2018 10:02:01 +0200
Kim Titcombe <[hidden email]> wrote:

> I am based in Switzerland but work in English (Windows in English),
> hence want English as default.

Which Windows version do you use? Which languages/language packs do you
have installed?

--
Best regards,
Ivan

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Help with setting locale

Ivan Krylov
On Sun, 16 Sep 2018 21:18:45 +0200
Kim Titcombe <[hidden email]> wrote:

> I have Windows 10. English version.

Do you have any other problems, besides the warning message at startup?

According to MSDN[1], the combination of English language
and Swiss cultural rules should be supported in Windows 10 >=
v1607 with a call like Sys.setlocale(locale="English_Switzerland"). If
that doesn't work, Sys.setlocale(locale="English") seemed to work even
on my Windows 2008 machine[2]. However, for some reason, when I call
setlocale() with two-letter arguments exactly as described on that page
("en-US", "en-CH", etc) the call fails.

--
Best regards,
Ivan

[1]: https://msdn.microsoft.com/library/cc233982.aspx

[2]: Also worked:

> Sys.setlocale(locale="English_United States")
[1] "LC_COLLATE=English_United States.1252;LC_CTYPE=English_United States.1252;LC_MONETARY=English_United States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252"
> Sys.setlocale(locale="English_United Kingdom")
[1] "LC_COLLATE=English_United Kingdom.1252;LC_CTYPE=English_United Kingdom.1252;LC_MONETARY=English_United Kingdom.1252;LC_NUMERIC=C;LC_TIME=English_United Kingdom.1252"

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.