scan-rotate: fix output encoding (use locale) using Term::Encoding
scan-rotate: micro-refactoring