I am trying to run a Python script with Japanese characters using git bash.
python test_print_jp.py
The code executed by this script is:
jp_str = u'ァアィイゥ'
print(jp_str)
While I am able to print the Japanese string in a notebook, I am not able to print the same string from git bash terminal.
The error is
UnicodeEncodeError: 'charmap' codec can't encode characters in position 0-4: character maps to <undefined>
I have tried changing the locale setting in .bash_profile:
export LANG=ja_JP.UTF-8
export LC_CTYPE=ja_JP.UTF-8
export LC_ALL=ja_JP.UTF-8
I have also tried modifying the string encoding:
str = u'ァアィイゥ'
print(str.encode('shift_jis'))
While there is no more error with the second solution, the output of the original string becomes b'\x83@\x83A\x83B\x83C\x83D'
I have also tried modifying the setting from the interface:
change_locale_setting_with_git_bash_interface
Is there a way to print the original Japanese string from git bash terminal?
Thank you for any inputs and suggestions :)

