[doc-en] master: Clarify iconv encoding and suffix portability (#6144)

From: Date: Wed, 25 Nov 2026 05:37:03 +0000
Subject: [doc-en] master: Clarify iconv encoding and suffix portability (#6144)
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-24014@lists.php.net to get a copy of this message
Author: Malek Kadri (malekkadri) Committer: GitHub (web-flow) Pusher: lacatoire Date: 2026-11-25T06:37:00+01:00 Commit: https://github.com/php/doc-en/commit/38950aec212c112badd7b4bd1f4df50f0f11e7c6 Raw diff: https://github.com/php/doc-en/commit/38950aec212c112badd7b4bd1f4df50f0f11e7c6.diff Clarify iconv encoding and suffix portability (#6144) Changed paths: M reference/iconv/functions/iconv.xml Diff: diff --git a/reference/iconv/functions/iconv.xml b/reference/iconv/functions/iconv.xml index eb092f699db6..021eb5e43604 100644 --- a/reference/iconv/functions/iconv.xml +++ b/reference/iconv/functions/iconv.xml @@ -38,24 +38,25 @@ <para> The desired encoding of the result. </para> - <para> - If the string <literal>//TRANSLIT</literal> is appended to - <parameter>to_encoding</parameter>, then transliteration is activated. This - means that when a character can't be represented in the target charset, - it may be approximated through one or several similarly looking - characters. If the string <literal>//IGNORE</literal> is appended, - characters that cannot be represented in the target charset are silently - discarded. Otherwise, <constant>E_NOTICE</constant> is generated and the function - will return &false;. - </para> + <simpara> + Appending <literal>//TRANSLIT</literal> to + <parameter>to_encoding</parameter> requests transliteration: + characters that cannot be represented in the target encoding may be + approximated by one or more similar characters. + Appending <literal>//IGNORE</literal> requests that characters which + cannot be represented in the target encoding be discarded. + Some implementations also support <literal>//NON_IDENTICAL_DISCARD</literal> + to discard valid input characters that have no identical representation + in the target encoding. + </simpara> <caution> - <para> - If and how <literal>//TRANSLIT</literal> works exactly depends on the - system's iconv() implementation (cf. <constant>ICONV_IMPL</constant>). - Some implementations are known to ignore <literal>//TRANSLIT</literal>, - so the conversion is likely to fail for characters which are illegal for - the <parameter>to_encoding</parameter>. - </para> + <simpara> + Whether these suffixes are supported and how they behave depend on the + system's iconv implementation (see <constant>ICONV_IMPL</constant>). + Without a supported suffix, unrepresentable characters may cause the + conversion to fail with an <constant>E_NOTICE</constant> and return + &false;, or may be handled differently by the implementation. + </simpara> </caution> </listitem> </varlistentry> @@ -113,12 +114,12 @@ Notice: iconv(): Detected an illegal character in input string in .\iconv-exampl <refsect1 role="notes"> &reftitle.notes; <note> - <para> - The character encodings and options available depend on the installed implementation - of iconv. If the argument to <parameter>from_encoding</parameter> - or <parameter>to_encoding</parameter> is not supported on the current system, &false; - will be returned. - </para> + <simpara> + The supported source and target encodings and their interpretation depend + on the installed iconv implementation. + If the implementation rejects the requested encoding or conversion, + &false; is returned. + </simpara> </note> </refsect1>

« previous php.doc.cvs (#24014) next »