| 1 |
#!/usr/bin/env python |
| 2 |
# -*- coding: UTF-8 -*- |
| 3 |
""" |
| 4 |
Explore encoding settings on a platform. |
| 5 |
""" |
| 6 |
|
| 7 |
from __future__ import print_function |
| 8 |
import sys |
| 9 |
import platform |
| 10 |
import locale |
| 11 |
from behave.textutil import select_best_encoding |
| 12 |
|
| 13 |
def explore_platform_encoding(): |
| 14 |
python_version = platform.python_version() |
| 15 |
print("python %s (platform: %s, %s, %s)" % (python_version, sys.platform, |
| 16 |
platform.python_implementation(), |
| 17 |
platform.platform())) |
| 18 |
print("sys.getfilesystemencoding(): %s" % sys.getfilesystemencoding()) |
| 19 |
print("locale.getpreferredencoding(): %s" % locale.getpreferredencoding()) |
| 20 |
print("behave.textutil.select_best_encoding(): %s" % select_best_encoding()) |
| 21 |
return 0 |
| 22 |
|
| 23 |
if __name__ == "__main__": |
| 24 |
sys.exit(explore_platform_encoding()) |