Created
July 28, 2016 11:27
-
-
Save typeon/6eeeba75354ecfb476dcb96ec58125f6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| # -*- coding: utf-8 -*- | |
| # | |
| import sys | |
| print('current cmd encoding : ', sys.stdout.encoding) | |
| # - ー, ・, 収, 録, 覧 - UnicodeEncodeError: cp949 codec cannot encode char. | |
| # | |
| str = 'ー ・ このグリフを収録するグループおよび引用するドキュメント一覧' | |
| if sys.stdout.encoding != 'utf-8': | |
| print(str.encode(sys.stdout.encoding, 'replace').decode(sys.stdout.encoding, 'replace')) | |
| else: | |
| print(str) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment