git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mike Hommey <mh@glandium.org>
To: git@vger.kernel.org
Subject: Support for non-ascii urls broken in some cases, help needed for Windows
Date: Sun, 27 Oct 2019 08:13:30 +0900	[thread overview]
Message-ID: <20191026231330.yfzml5wrmavtntph@glandium.org> (raw)

Hi,

I don't actually know of any git hosting that lives on a non-ascii
domain and with non-ascii parts in the path, but I nevertheless gave it
a shot because I was wondering how a conversion of git-cinnabar to
python 3 should handle them.

Multiple problems arose when trying `git clone https://テスト.com`:
- with NO_GETTEXT set, setlocale is never called, and when curl calls
  libidn for conversion of the domain name, it fails with
  "Failed to convert テスト.com to ACE; could not convert string to
  UTF-8" because, while the string *is* UTF-8, it thinks it's ASCII and
  wants to convert it somehow.

  Calling setlocale(LC_CTYPE, "") before the curl request happens fixes
  this. It feels like git_setup_gettext in the NO_GETTEXT case should
  take care of this.

- On Windows with a Japanese locale, it fails with the same error.
  Earlier versions of git failed with a different error message. I
  suspect 090d1e84771bb4a310e3fe8291ec71b0ddb03d4f is involved in the
  change in error message but I'm not sure. Anyways, I think the problem
  here is that what git gets as input from the command line is not UTF-8,
  and curl fails to convert it however it tries to. However, for
  non-ascii path parts, it seems a conversion to UTF-8 happens correctly
  at some stage, so I'm not entirely sure. That is,
  `git clone http://localhost:8000/テスト` does send a UTF-8 テスト to
  the HTTP server (which, interestingly, is not what
  `curl http://localhost:8000/テスト` does).

I'm happy to look at fixing the NO_GETTEXT unix part, but I'm not
equipped to build git for windows the way it's shipped to look at it
there.

Mike

                 reply	other threads:[~2019-10-26 23:54 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191026231330.yfzml5wrmavtntph@glandium.org \
    --to=mh@glandium.org \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).