HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/projects/buyercall/node_modules/node-gyp/test/fixtures/test-charmap.py
import sys
import locale

try:
    reload(sys)
except NameError:  # Python 3
    pass


def main():
    encoding = locale.getdefaultlocale()[1]
    if not encoding:
        return False

    try:
        sys.setdefaultencoding(encoding)
    except AttributeError:  # Python 3
        pass

    textmap = {
        "cp936": "\u4e2d\u6587",
        "cp1252": "Lat\u012Bna",
        "cp932": "\u306b\u307b\u3093\u3054",
    }
    if encoding in textmap:
        print(textmap[encoding])
    return True


if __name__ == "__main__":
    print(main())