source: trip-planner-front/node_modules/node-gyp/test/fixtures/test-charmap.py@ 571e0df

Last change on this file since 571e0df was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 535 bytes
Line 
1from __future__ import print_function
2import sys
3import locale
4
5try:
6 reload(sys)
7except NameError: # Python 3
8 pass
9
10def 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': u'\u4e2d\u6587',
22 'cp1252': u'Lat\u012Bna',
23 'cp932': u'\u306b\u307b\u3093\u3054'
24 }
25 if encoding in textmap:
26 print(textmap[encoding])
27 return True
28
29if __name__ == '__main__':
30 print(main())
Note: See TracBrowser for help on using the repository browser.