str.encode(encoding [, options] ) â strstr.encode(dst_encoding, src_encoding [, options] ) â strstr.encode([options]) â str
Instance Public methods
The first form returns a copy of str transcoded to encoding
encoding. The second form returns a copy of str
transcoded from src_encoding to dst_encoding. The last form returns a copy
of str transcoded to Encoding.default_internal.
By default, the first and second form raise Encoding::UndefinedConversionError
for characters that a