[PATCH v2] manual: Document //TRANSLIT and //IGNORE support in iconv_open [BZ #3794]
Avinal Kumar
avinal.xlvii@gmail.com
Thu Dec 18 14:15:07 GMT 2025
The //TRANSLIT and //IGNORE suffix supported by iconv_open
was not documented in the glibc manual. This commit adds the
documentation for the suffixes.
This fixes BZ #3794.
Signed-off-by: Avinal Kumar <avinal.xlvii@gmail.com>
---
Changes from v1:
Added a paragraph documenting the combined uses of suffixes.
Refer: https://man7.org/linux/man-pages/man1/iconv.1.html and
https://www.gnu.org/savannah-checkouts/gnu/libiconv/documentation/libiconv-1.18/iconv_open.3.html
manual/charset.texi | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/manual/charset.texi b/manual/charset.texi
index 3aaa62d088..21c17b6d14 100644
--- a/manual/charset.texi
+++ b/manual/charset.texi
@@ -1687,6 +1687,24 @@ source and destination character set for the conversion, and if the
implementation has the possibility to perform such a conversion, the
function returns a handle.
+The @var{tocode} argument may optionally be suffixed with
+@code{//TRANSLIT}. When this suffix is present, transliteration is
+enabled. With transliteration enabled, characters that cannot be
+represented directly in the destination character set may be approximated
+using one or more similar characters that are available in the
+destination character set. Characters outside of the destination
+character set and cannot be transliterated are replaced with a question
+mark @code{?}.
+
+The @var{tocode} argument may also be suffixed with @code{//IGNORE}.
+When this suffix is present, characters that cannot be converted are
+silently discarded.
+
+The suffixes may be combined, for example @code{//TRANSLIT,IGNORE}.
+When both suffixes are specified, transliteration is attempted first.
+If a character cannot be transliterated, it is then handled according
+to @code{//IGNORE}.
+
If the wanted conversion is not available, the @code{iconv_open} function
returns @code{(iconv_t) -1}. In this case the global variable
@code{errno} can have the following values:
--
2.52.0
More information about the Libc-alpha
mailing list