Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"cocos run -p web" raises UnicodeEncodeError in Traditional Chinese Windows #419

Open
whitglint opened this issue Apr 29, 2017 · 0 comments

Comments

@whitglint
Copy link

Error

cocos run -p web
編譯模式:debug
部署模式:debug
Traceback (most recent call last):
File "C:\cocos2d-x-3.15\tools\cocos2d-console\bin/cocos.py", line 1027, in
run_plugin(command, argv, plugins)
File "C:\cocos2d-x-3.15\tools\cocos2d-console\bin/cocos.py", line 916, in run_plugin
plugin.run(argv, dependencies_objects)
File "C:\cocos2d-x-3.15\tools\cocos2d-console\plugins\plugin_run\project_run.py", line 341, in run
self.parse_args(argv)
File "C:\cocos2d-x-3.15\tools\cocos2d-console\bin\cocos.py", line 615, in parse_args
self._add_custom_options(parser)
File "C:\cocos2d-x-3.15\tools\cocos2d-console\plugins\plugin_run\project_run.py", line 56, in _add_custom_options
help=MultiLanguage.get_string('RUN_ARG_NO_CONSOLE'))
File "C:\cocos2d-x-3.15\tools\cocos2d-console\bin\MultiLanguage.py", line 52, in get_string
fmt = cls.get_instance().get_current_string(key)
File "C:\cocos2d-x-3.15\tools\cocos2d-console\bin\MultiLanguage.py", line 158, in get_current_string
ret = ret.encode(self.encoding)
UnicodeEncodeError: 'cp950' codec can't encode character u'\u7ed9' in position 56: illegal multibyte sequence

Fix

There are some Simplified Chinese characters in Traditional Chinese string in bin/strings.json file:

  • Line 746:
    Incorrect:
    "RUN_ARG_NO_CONSOLE" : "關閉 Windows,Mac 和 Linux 下的模擬器控制檯視窗(傳入命令行參數 '-console no' 给模擬器)。",
    Correct:
    "RUN_ARG_NO_CONSOLE" : "關閉 Windows,Mac 和 Linux 下的模擬器控制檯視窗(傳入命令行參數 '-console no' 給模擬器)。",

  • Line 747:
    Incorrect:
    "RUN_ARG_WORKING_DIR" : "設定 Windows,Mac 和 Linux 下模擬器運行的工作目錄(傳入命令行參數 '-workdir \"<path>\"' 给模擬器)。",
    Correct:
    "RUN_ARG_WORKING_DIR" : "設定 Windows,Mac 和 Linux 下模擬器運行的工作目錄(傳入命令行參數 '-workdir \"<path>\"' 給模擬器)。",

  • Line 871:
    Incorrect:
    "COMPILE_INFO_USE_COCOAPODS" : "檢測到 CocoaPods:使用 xcworkspace 进行编译。",
    Correct:
    "COMPILE_INFO_USE_COCOAPODS" : "檢測到 CocoaPods:使用 xcworkspace 進行編譯。",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant