From 5dad4a94dd6bf3fefc4a0d9f087d4f6d857cb3e7 Mon Sep 17 00:00:00 2001 From: smeyer Date: Tue, 11 Feb 2025 21:48:08 +0000 Subject: [PATCH] update musl-specific comments git-svn-id: https://svn.r-project.org/R/trunk@87713 00db46b3-68df-0310-9c12-caf00c1e9a41 --- src/library/base/man/iconv.Rd | 12 ++++++------ src/main/sysutils.c | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/library/base/man/iconv.Rd b/src/library/base/man/iconv.Rd index 4d527e4e713..fa9f496d485 100644 --- a/src/library/base/man/iconv.Rd +++ b/src/library/base/man/iconv.Rd @@ -46,7 +46,9 @@ iconvlist() Generally case is ignored when specifying an encoding. On most platforms \code{iconvlist} provides an alphabetical list of - the supported encodings. On others, the information is on the man + the supported encodings (including aliases). On \samp{musl} (as used + by Alpine Linux and other lightweight Linux distributions) the listing + is incomplete. On others, the information is on the man page for \code{iconv(5)} or elsewhere in the man pages (but beware that the system command \code{iconv} may not support the same set of encodings as the C functions \R calls). Unfortunately, the names are @@ -62,7 +64,7 @@ iconvlist() Encoding \code{"ASCII"} is accepted, and on most systems \code{"C"} and \code{"POSIX"} are synonyms for ASCII. Where - \code{"ASCII/TRANSLIT"} is unsupported by the OS, \code{"ASCII"} is + \code{"ASCII//TRANSLIT"} is unsupported by the OS, \code{"ASCII"} is used with \code{sub = "c99"} if from UTF-8, else \code{sub = "?"}. (However, \I{musl}'s version of \code{"ASCII"} substitutes \code{*}.) @@ -177,10 +179,8 @@ iconvlist() \note{ The most portable name for the ISO 8859-15 encoding, commonly known as \sQuote{Latin 9}, is \code{"iso885915"}: most platforms support both - \code{"latin-9"} and\code{"latin9"} but GNU \samp{libiconv} does not - support the latter. \samp{musl} (as used by Alpine Linux and other - lightweight Linux distributions) supports neither, but \R remaps there - to \code{"iso885915"}. + \code{"latin-9"} and \code{"latin9"} % (including \samp{musl}) + but GNU \samp{libiconv} does not support the latter. Encoding names \code{"utf8"}, \code{"mac"} and \code{"macroman"} are not portable. \code{"utf8"} is converted to \code{"UTF-8"} for diff --git a/src/main/sysutils.c b/src/main/sysutils.c index f931139f8e6..3cdf21e52fb 100644 --- a/src/main/sysutils.c +++ b/src/main/sysutils.c @@ -656,6 +656,7 @@ attribute_hidden SEXP do_iconv(SEXP call, SEXP op, SEXP args, SEXP env) from = "iso88592"; if(R_strieql(to, "latin-2") || R_strieql(to, "latin2") ) to = "iso88592"; + /* the following is redundant (musl does know about the latin9 alias) */ if(R_strieql(from, "latin-9") || R_strieql(from, "latin9") ) from = "iso885915"; if(R_strieql(to, "latin-9") || R_strieql(to, "latin9") )