I have a perl script that prints some information开发者_Go百科 to console in Russian. Script will be executed on several OSes, so console encoding can be cp866, koi8-r, utf-8, or some other. Is there a portable way to detect console encoding so I can setup STDOUT accordingly so the text is printed correctly?
If you're on Windows, there's Win32::Codepage.
use open ':locale';
- Term::Detect::Software
- Term::Encoding
精彩评论