From 11f28f3268f9234b6310bc659de7e46dfc5c0706 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20D=C3=BCrst?= Date: Mon, 16 Jan 2023 16:25:04 +0900 Subject: [DOC] Explain that transcoding to the same encoding just copies. This is a reenstatement of the explanation in commit 463633e4a934a00f869086a6ffbf84c6cb8ad630 to partially address Bug #19342. --- doc/string/encode.rdoc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'doc/string') diff --git a/doc/string/encode.rdoc b/doc/string/encode.rdoc index 2872887ef1..a7d400724d 100644 --- a/doc/string/encode.rdoc +++ b/doc/string/encode.rdoc @@ -38,3 +38,9 @@ interprets +self+ using +src_encoding+, encodes the new string using +dst_encodi Optional keyword arguments +enc_opts+ specify encoding options; see {Encoding Options}[rdoc-ref:encodings.rdoc@Encoding+Options]. + +Please note that conversion from an encoding +enc+ to the same encoding ++enc+ (independent of whether +enc+ is given explicitly or implicitly) +is a no-op, i.e. the string is simply copied without any changes, and +no exceptions are raised, even if there are invalid bytes. + -- cgit v1.2.1