finki-main
main
|
Last change
on this file since 81bc7da was 81bc7da, checked in by Klimentina Efremova <klimentina08642@…>, 3 months ago |
|
Initial commit
|
-
Property mode
set to
100644
|
|
File size:
547 bytes
|
| Line | |
|---|
| 1 | import sys
|
|---|
| 2 | import locale
|
|---|
| 3 |
|
|---|
| 4 | try:
|
|---|
| 5 | reload(sys)
|
|---|
| 6 | except NameError: # Python 3
|
|---|
| 7 | pass
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 | def main():
|
|---|
| 11 | encoding = locale.getdefaultlocale()[1]
|
|---|
| 12 | if not encoding:
|
|---|
| 13 | return False
|
|---|
| 14 |
|
|---|
| 15 | try:
|
|---|
| 16 | sys.setdefaultencoding(encoding)
|
|---|
| 17 | except AttributeError: # Python 3
|
|---|
| 18 | pass
|
|---|
| 19 |
|
|---|
| 20 | textmap = {
|
|---|
| 21 | "cp936": "\u4e2d\u6587",
|
|---|
| 22 | "cp1252": "Lat\u012Bna",
|
|---|
| 23 | "cp932": "\u306b\u307b\u3093\u3054",
|
|---|
| 24 | }
|
|---|
| 25 | if encoding in textmap:
|
|---|
| 26 | print(textmap[encoding])
|
|---|
| 27 | return True
|
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 | if __name__ == "__main__":
|
|---|
| 31 | print(main())
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.