m13253 / danmaku2ass

Convert comments from Niconico/AcFun/bilibili to ASS format
http://m13253.blogspot.com/2013/11/play-danmaku-offline-danmaku2ass.html
GNU General Public License v3.0
556 stars 92 forks source link

Crash when loading translation files (Py2 version) #23

Closed persmule closed 9 years ago

persmule commented 9 years ago

When convert xml danmaku to ass via danmaku2ass (py2 version) on Debian GNU/Linux Stretch, it reports:

Traceback (most recent call last): File "../danmaku2ass2.py", line 40, in gettext.install('danmaku2ass', os.path.join(os.path.dirname(os.path.abspath(os.path.realpath(sys.argv[0] or 'locale'))), 'locale')) File "/usr/lib/python2.7/posixpath.py", line 73, in join path += '/' + b UnicodeDecodeError: 'ascii' codec can't decode byte 0xe8 in position 11: ordinal not in range(128)

danmaku2ass (py3 version) works with no problem.

m13253 commented 9 years ago

UnicodeDecodeError: 'ascii' codec can't decode byte 0xe8 in position 11: ordinal not in range(128)

你没有设置系统语言,而 Danmaku2ASS 的主程序放在了含有特殊字符(如中文)的路径下了。 解决方法有两个:

  1. 设置系统语言,中文或英文皆可。编码(如果询问)填 UTF-8。
  2. 把程序放到英文字符的路径下。

如果还是无法解决,请发上来 locale 命令的输出。

Duplicate: https://github.com/cnbeining/Biligrab/issues/18

persmule commented 9 years ago

$ locale LANG=zh_CN.UTF-8 LANGUAGE= LC_CTYPE="zh_CN.UTF-8" LC_NUMERIC="zh_CN.UTF-8" LC_TIME="zh_CN.UTF-8" LC_COLLATE="zh_CN.UTF-8" LC_MONETARY="zh_CN.UTF-8" LC_MESSAGES="zh_CN.UTF-8" LC_PAPER="zh_CN.UTF-8" LC_NAME="zh_CN.UTF-8" LC_ADDRESS="zh_CN.UTF-8" LC_TELEPHONE="zh_CN.UTF-8" LC_MEASUREMENT="zh_CN.UTF-8" LC_IDENTIFICATION="zh_CN.UTF-8" LC_ALL=