{"action":"created","issue":{"url":"https://api.github.com/repos/ovalhub/pyicu/issues/6","repository_url":"https://api.github.com/repos/ovalhub/pyicu","labels_url":"https://api.github.com/repos/ovalhub/pyicu/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/ovalhub/pyicu/issues/6/comments","events_url":"https://api.github.com/repos/ovalhub/pyicu/issues/6/events","html_url":"https://github.com/ovalhub/pyicu/issues/6","id":104861239,"number":6,"title":"Creation of Collator for Chinese locals fails","user":{"login":"pgammans","id":1038578,"avatar_url":"https://avatars.githubusercontent.com/u/1038578?v=3","gravatar_id":"","url":"https://api.github.com/users/pgammans","html_url":"https://github.com/pgammans","followers_url":"https://api.github.com/users/pgammans/followers","following_url":"https://api.github.com/users/pgammans/following{/other_user}","gists_url":"https://api.github.com/users/pgammans/gists{/gist_id}","starred_url":"https://api.github.com/users/pgammans/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pgammans/subscriptions","organizations_url":"https://api.github.com/users/pgammans/orgs","repos_url":"https://api.github.com/users/pgammans/repos","events_url":"https://api.github.com/users/pgammans/events{/privacy}","received_events_url":"https://api.github.com/users/pgammans/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2015-09-04T09:55:43Z","updated_at":"2016-07-20T09:54:54Z","closed_at":null,"body":"Creating a Collator and rebuilding from its rules fails for Chinese Collator's\r\n\r\nThe following code works if you change the locale to `Locale(\"en\", \"US\", \"\")` , `Locale(\"da\", \"DK\", \"\")` and a few others but not `Locale(\"zh\", \"hant\", \"TW\")` , `Locale(\"zh\", \"hans\", \"CN\")` , `Locale(\"zh\",  \"CN\")`\r\n\r\n```\r\nimport icu\r\nzh_TWCollator= icu.Collator.createInstance(icu.Locale(\"zh\", \"TW\"))\r\nzh_TWRules = zh_TWCollator.getRules();\r\nnewCollator = icu.RuleBasedCollator(zh_TWRules)\r\n```\r\nTraceback (most recent call last):\r\n  File \"\\<input>\", line 1, in \\<module>\r\nICUError: Character conversion: Unmappable input sequence. In other APIs: Invalid character., error code: 10\r\n\r\n\r\nie this line fails.\r\n```\r\nicu.Collator.createInstance(icu.Locale(\"zh\", \"TW\"))\r\n```\r\nTraceback (most recent call last):\r\n  File \"\\<input>\", line 1, in \\<module>\r\nUnicodeEncodeError: 'ascii' codec can't encode character u'\\u0101' in position 34: ordinal not in range(128)\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/ovalhub/pyicu/issues/comments/233905080","html_url":"https://github.com/ovalhub/pyicu/issues/6#issuecomment-233905080","issue_url":"https://api.github.com/repos/ovalhub/pyicu/issues/6","id":233905080,"user":{"login":"wfdd","id":8489551,"avatar_url":"https://avatars.githubusercontent.com/u/8489551?v=3","gravatar_id":"","url":"https://api.github.com/users/wfdd","html_url":"https://github.com/wfdd","followers_url":"https://api.github.com/users/wfdd/followers","following_url":"https://api.github.com/users/wfdd/following{/other_user}","gists_url":"https://api.github.com/users/wfdd/gists{/gist_id}","starred_url":"https://api.github.com/users/wfdd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wfdd/subscriptions","organizations_url":"https://api.github.com/users/wfdd/orgs","repos_url":"https://api.github.com/users/wfdd/repos","events_url":"https://api.github.com/users/wfdd/events{/privacy}","received_events_url":"https://api.github.com/users/wfdd/received_events","type":"User","site_admin":false},"created_at":"2016-07-20T09:54:54Z","updated_at":"2016-07-20T09:54:54Z","body":"> Clearly but the exception it actually raises may be hidden by the exception\r\n> piled on while failing to print it.\r\n\r\nIt fails before actually attempting to print it:\r\n\r\n```py\r\nIn [1]: import icu, sys\r\n\r\nIn [2]: zh_TWCollator = icu.Collator.createInstance(icu.Locale(\"zh\", \"TW\"))\r\n\r\nIn [3]: zh_TWRules = zh_TWCollator.getRules()\r\n\r\nIn [4]: newCollator = icu.RuleBasedCollator(zh_TWRules)\r\n---------------------------------------------------------------------------\r\nICUError                                  Traceback (most recent call last)\r\n<ipython-input-4-f60a2f78d633> in <module>()\r\n----> 1 newCollator = icu.RuleBasedCollator(zh_TWRules)\r\n\r\nICUError: Character conversion: Unmappable input sequence. In other APIs: Invalid character., error code: 10\r\n\r\nIn [5]: sys.version, icu.VERSION, icu.ICU_VERSION\r\nOut[5]: \r\n('3.5.2 (default, Jun 29 2016, 23:50:40) \\n[GCC 4.2.1 Compatible Apple LLVM 7.3.0 (clang-703.0.31)]',\r\n '1.9.3',\r\n '57.1')\r\n```\r\n\r\n> Not sure what you mean by 'pre-generated' data. I built ICU 57.1 from\r\n> sources as downloaded from the ICU site.\r\n\r\nThe ICU folk provide a precompiled data archive (http://site.icu-project.org/download/57#TOC-ICU4C-Download); oddly, the collations in that archive don't contain these suspect surrogate pairs."}}
{"actor":{"display_login":"wfdd"}}