- encoding means taking a Perl string and transforming it in a binary buffer that represents the same string, in some codepage.
- decoding is the opposite: taking a binary buffer that you know is encoded in some codepage and transforming it in a Perl string
Perl strings are arrays of codepoints (Unicode characters) that can represented internally either as a Latin1-encoded buffer or as a (relaxed) UTF-8 encoded buffer.
So, in your examples, there is no "encoding from XXX to XXX" (unless you use Encode::from_to, that is a decode followed by an encode).
You can get a string that you know it's in the UTF-8 codepage, decode it (save it in Perl internal format) and then encode that internal string, for instance to the Latin1 codepage.