{"thread":{"id":"52130","subject":"Support for non-ascii urls broken in some cases, help needed for Windows","startedAt":"2019-10-26T23:54:31Z","lastAt":"2019-10-26T23:54:31Z","messageCount":1,"participants":["Mike Hommey"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"384925","messageId":"20191026231330.yfzml5wrmavtntph@glandium.org","threadId":"52130","inReplyTo":null,"subject":"Support for non-ascii urls broken in some cases, help needed for Windows","fromName":"Mike Hommey","fromEmail":"mh@glandium.org","sentAt":"2019-10-26T23:13:30Z","receivedAt":"2019-10-26T23:54:31Z","isPatch":false,"sender":{"key":"mh@glandium.org","avatar":"https://avatars.githubusercontent.com/u/1038527?v=4"},"body":"Hi,\n\nI don't actually know of any git hosting that lives on a non-ascii\ndomain and with non-ascii parts in the path, but I nevertheless gave it\na shot because I was wondering how a conversion of git-cinnabar to\npython 3 should handle them.\n\nMultiple problems arose when trying `git clone https://テスト.com`:\n- with NO_GETTEXT set, setlocale is never called, and when curl calls\n  libidn for conversion of the domain name, it fails with\n  \"Failed to convert テスト.com to ACE; could not convert string to\n  UTF-8\" because, while the string *is* UTF-8, it thinks it's ASCII and\n  wants to convert it somehow.\n\n  Calling setlocale(LC_CTYPE, \"\") before the curl request happens fixes\n  this. It feels like git_setup_gettext in the NO_GETTEXT case should\n  take care of this.\n\n- On Windows with a Japanese locale, it fails with the same error.\n  Earlier versions of git failed with a different error message. I\n  suspect 090d1e84771bb4a310e3fe8291ec71b0ddb03d4f is involved in the\n  change in error message but I'm not sure. Anyways, I think the problem\n  here is that what git gets as input from the command line is not UTF-8,\n  and curl fails to convert it however it tries to. However, for\n  non-ascii path parts, it seems a conversion to UTF-8 happens correctly\n  at some stage, so I'm not entirely sure. That is,\n  `git clone http://localhost:8000/テスト` does send a UTF-8 テスト to\n  the HTTP server (which, interestingly, is not what\n  `curl http://localhost:8000/テスト` does).\n\nI'm happy to look at fixing the NO_GETTEXT unix part, but I'm not\nequipped to build git for windows the way it's shipped to look at it\nthere.\n\nMike\n"}]}