[DOC] Update String#encode special case

This behavior has been slightly extended with the addition of
`String#scrub`.
This commit is contained in:
Nobuyoshi Nakada 2023-01-16 19:44:40 +09:00
parent 11f28f3268
commit a2748c500d
No known key found for this signature in database
GPG Key ID: 7CD2805BFA3770C6

View File

@ -39,8 +39,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.
Please note that, unless <code>invalid: :replace</code> option is
given, 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.