Skip to content

Commit

Permalink
Warn with C.UTF-8 too
Browse files Browse the repository at this point in the history
See these glibc changes:

********************************************************************
commit 2897b231a6b71ee17d47d3d63f1112b2641a476c
Author: Bruno Haible <bruno@clisp.org>
Date:   Mon Sep 4 15:31:36 2023 +0200

    intl: Treat C.UTF-8 locale like C locale (BZ# 16621)

    The wiki page https://sourceware.org/glibc/wiki/Proposals/C.UTF-8
    says that "Setting LC_ALL=C.UTF-8 will ignore LANGUAGE just like it
    does with LC_ALL=C." This patch implements it.

    * intl/dcigettext.c (guess_category_value): Treat C.<encoding> locale
    like the C locale.

    Reviewed-by: Florian Weimer <fweimer@redhat.com>
*********************************************************************

via

*********************************************************************
  * debian/patches/any/git-c-utf-8-language.diff: backport support from
    upstream to treat C.<encoding> locale like C locale.  Closes: #874160.
*********************************************************************
  • Loading branch information
lionel- committed Sep 19, 2023
1 parent bd97d3a commit 687f3a3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions R/language.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,11 @@ local_language <- function(lang, .local_envir = parent.frame()) {
# > (or LC_ALL) to a value other than ‘C’, before you can use a language
# > priority list through the LANGUAGE variable.
# --- https://www.gnu.org/software/gettext/manual/html_node/The-LANGUAGE-variable.html
if (identical(Sys.getenv("LANG"), "C")) {
warning("Changing language has no effect when envvar LANG='C'")
if (Sys.getenv("LANG") %in% c("C", "C.UTF-8")) {
warning(sprintf(
"Changing language has no effect when envvar LANG='%s'",
Sys.getenv("LANG")
))
}

local_envvar(LANGUAGE = lang, .local_envir = .local_envir)
Expand Down

0 comments on commit 687f3a3

Please sign in to comment.