It looks like it's not possible.
As a partial workaround, you may use
iconv as an input preprocessor in the following way.
- Create the following executable script, say
iconv -f $IN_ENC -t $OUT_ENC $1
- Define and export the
export LESSOPEN="|-less_conv.sh %s"
less this way:
IN_ENC=latin2 OUT_ENC=utf8 less somefile
You may also set your preferred values:
The pipe character
LESSOPEN saves the need for a temporary intermediate file. The dash
- enables this preprocessor when
less reads standard input.
The preprocessor is invoked only once, even if you hit
R, so you won't be able to use this workaround on growing files or "streaming" standard input.