git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Potapov <dpotapov@gmail.com>
To: Peter Krefting <peter@softwolves.pp.se>
Cc: git@vger.kernel.org
Subject: Re: [RFC PATCH] Windows: Assume all file names to be UTF-8 encoded.
Date: Tue, 3 Mar 2009 12:43:55 +0300	[thread overview]
Message-ID: <37fcd2780903030143t7abe33d5sb7d8163c3c9bf505@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.00.0903020941120.17877@perkele.intern.softwolves.pp.se>

On Mon, Mar 02, 2009 at 09:47:22AM +0100, Peter Krefting wrote:
> When opening a file through open() or fopen(), the path passed is
> UTF-8 encoded. To handle this on Windows, we need to convert the
> path string to UTF-16 and use the Unicode-based interface.

IMHO, you grossly underestimate what is needed to enable UTF-8 encoding
in Windows. AFAIK, Microsoft C runtime library does not support UTF-8,
so you have to wrap all C functions taking 'char*' as an input parameter.
For example, think about what is going to happen if Git tries to print
a simple error message:
  fprintf (stderr, "unable to open %s", path);

> Since there is no real file system abstraction beyond using stdio_
> (AFAIK), I need to hack it by replacing fopen (and open). Probably_
> opendir/readdir as well (might be trickier), and possibly even hack_
> around main() to parse the wchar_t command-line instead of the char copy.

And the command-line is not the only source of file names. Some Git
commands read list of files from stdin usually though the pipe. In
what encoding are they going to be?

Dmitry

  parent reply	other threads:[~2009-03-03  9:45 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-02  8:47 [RFC PATCH] Windows: Assume all file names to be UTF-8 encoded Peter Krefting
2009-03-02 10:30 ` Johannes Sixt
2009-03-02 10:46   ` Peter Krefting
2009-03-02 10:56     ` Johannes Schindelin
2009-03-02 12:03       ` Peter Krefting
     [not found]         ` <a2633edd0903020512u5682e9am203f0faccd0acf6a@mail.gmail.com>
2009-03-02 13:57           ` Peter Krefting
2009-03-02 14:29             ` Thomas Rast
2009-03-02 20:41               ` Peter Krefting
2009-03-03  7:56                 ` Lars Noschinski
2009-03-03 11:54                   ` Peter Krefting
2009-03-03 16:29                     ` Lars Noschinski
2009-03-03 20:59                       ` Robin Rosenberg
2009-03-03  9:47                 ` Dmitry Potapov
2009-03-03 11:48                   ` Peter Krefting
2009-03-03 17:13                     ` Dmitry Potapov
2009-03-04 10:51                       ` Peter Krefting
2009-03-04 14:18                         ` Dmitry Potapov
2009-03-02 12:34     ` Johannes Sixt
2009-03-02 13:12       ` Peter Krefting
2009-03-02 19:58         ` Robin Rosenberg
2009-03-02 20:52           ` Peter Krefting
2009-03-02 21:21             ` Robin Rosenberg
2009-03-03  5:51               ` Peter Krefting
2009-03-03  9:43 ` Dmitry Potapov [this message]
2009-03-03 11:56   ` Peter Krefting
2009-03-07 10:38 ` Robin Rosenberg
  -- strict thread matches above, loose matches on Subject: below --
2009-03-03 18:25 John Dlugosz
2009-03-04 10:53 ` Peter Krefting
2009-03-04 19:34   ` John Dlugosz
2009-03-03 19:36 John Dlugosz
2009-03-03 20:39 John Dlugosz
2009-03-03 21:02 ` Dmitry Potapov
2009-03-03 21:56   ` John Dlugosz

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=37fcd2780903030143t7abe33d5sb7d8163c3c9bf505@mail.gmail.com \
    --to=dpotapov@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=peter@softwolves.pp.se \
    /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).