*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]]
> On Sep 14, 2018, at 1:02 AM, Kim Titcombe <ktitcombe02 at gmail.com> 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]] > > ______________________________________________ > R-help at r-project.org 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
> On Sep 14, 2018, at 8:44 AM, David Winsemius <dwinsemius at comcast.net> wrote: > > >> On Sep 14, 2018, at 1:02 AM, Kim Titcombe <ktitcombe02 at gmail.com> 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]] >> >> ______________________________________________ >> R-help at r-project.org 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 > > ______________________________________________ > R-help at r-project.org 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
On Fri, 14 Sep 2018 10:02:01 +0200 Kim Titcombe <ktitcombe02 at gmail.com> 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
On Sun, 16 Sep 2018 21:18:45 +0200 Kim Titcombe <ktitcombe02 at gmail.com> 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"