summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorMartin Dürst <duerst@it.aoyama.ac.jp>2023-01-16 16:25:04 +0900
committerMartin Dürst <duerst@it.aoyama.ac.jp>2023-01-16 16:30:15 +0900
commit11f28f3268f9234b6310bc659de7e46dfc5c0706 (patch)
treec84776d18020be6ed20a6180ee360d5b23cb63ee /doc
parent468ce1488d26ffc92c940324794dc9257f72b5d2 (diff)
[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.
Diffstat (limited to 'doc')
-rw-r--r--doc/string/encode.rdoc6
1 files changed, 6 insertions, 0 deletions
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.
+