diff options
| author | Jeff Quast <contact@jeffquast.com> | 2014-11-27 14:40:54 -0800 |
|---|---|---|
| committer | Jeff Quast <contact@jeffquast.com> | 2014-11-27 14:40:54 -0800 |
| commit | 080674ff11c5b11e0b082917c4a0a34d2ba03216 (patch) | |
| tree | 397f11593c2b2899533cadbfe8219a2cd65a0400 | |
| parent | ad1daab2ebe5adc62f23a7f5e2779ddbcdd844c7 (diff) | |
| download | pexpect-080674ff11c5b11e0b082917c4a0a34d2ba03216.tar.gz | |
Display locale in tools/display-terminalinfo.py
| -rwxr-xr-x | tools/display-terminalinfo.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/display-terminalinfo.py b/tools/display-terminalinfo.py index 9f56022..b6e9ac6 100755 --- a/tools/display-terminalinfo.py +++ b/tools/display-terminalinfo.py @@ -2,6 +2,7 @@ """ Display known information about our terminal. """ from __future__ import print_function import termios +import locale import sys import os @@ -170,6 +171,8 @@ def display_conf(kind, names, getter): def main(): fd = sys.stdin.fileno() + locale.setlocale(locale.LC_ALL, '') + encoding = locale.getpreferredencoding() print('os.isatty({0}) => {1}'.format(fd, os.isatty(fd))) @@ -199,6 +202,7 @@ def main(): cc=cc) print('os.ttyname({0}) => {1}'.format(fd, os.ttyname(fd))) print('os.ctermid() => {0}'.format(os.ttyname(fd))) + print('locale.getpreferredencoding() => {0}'.format(encoding)) if __name__ == '__main__': |
