```{index} single: native_obj_encode; Encode function ``` ```{index} single: Encode::native_obj_encode; Perl function ``` # native_obj_encode Method form of `encode` on an encoding object. ## Synopsis ```perl my $enc = find_encoding('UTF-8'); my $bytes = $enc->encode($string); my $bytes = $enc->encode($string, $check); ``` Behaves like the function form of `encode` with the encoding name already bound. When `$check` is non-zero, the portion of `$string` that was successfully consumed is removed from it, mirroring the behaviour upstream documents for `$check != 0`.