in reply to Re^4: Decoding Russian text
in thread Decoding Russian text

But I want to apply encoding to a single string, not to an input stream.

uh, that's what the program already does. decode($enc, $str)