Documentation for method encode

Documentation for method encode, assembled from the following types:

class Str

From Str

(Str) method encode

multi method encode(Str:D: $encoding$nf --> Blob)

Returns a Blob which represents the original string in the given encoding and normal form. The actual return type is as specific as possible, so $str.encode('UTF-8') returns a utf8 object, $str.encode('ISO-8859-1') a buf8.