git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Timur Sufiev: Re: [PATCH I18N filenames v2 3/3] Provide compatibility with MinGW

From
Timur Sufiev <tsufiev@gmail.com>
Date
Nov 6, 2009, 10:00 UTC
Message-ID
<4af3f3cb.0305560a.7a34.0f43@mx.google.com>
Hello, Peter
Show 16 quoted lines
> Hi!
> 
> Instead of calling the open_i18n() which converts from UTF-8 to a local 
> 8-bit character set, this should probably call a version that converts from 
> UTF-8 to UTF-16 and uses _wopen().
> 
> Same thing for fopen_i18n() and _wfopen().
> 
> I created a small RFC patch for that that changed parts of the system 
> earlier this year - http://kerneltrap.org/mailarchive/git/2009/3/2/5350814
> 
> I did not address readdir() and friends, I'm not sure if they are available 
> in UTF-16 form or if they need to be rewritten using findfirst()/findnext().
> 
> -- 
> \\// Peter - http://www.softwolves.pp.se/

I've decided to stick to local 8-bit encoding for now having considered the following issues:

1. Many git front-ends, e.g. TortoiseGit, use 8-bit set, not UTF-16:
they call git plumbing commands and pass filenames to command line (in
local 8-bit encoding). So, using [UTF-8] <-> [UTF-16] approach, I had to
deal with 3 different encodings: UTF-8, UTF-16 and local 8-bit one
(CP1251 in my case). Moreover, Windows itself uses both UTF-16 and
CP1251, so one had to deal with reencoding between them (if he plans to
support UTF-16). Too much confusion.
 
2. UTF-16 is a proper solution for Windows, but my patch is useful for
other OSes with locales different from UTF-8 (e.g. Linux with KOI8-R
locale).

Still there is a possibility that one day we'll stumble upon some UTF-8 symbol which cannot not be correctly mapped into 8-bit encoding. UTF-16 would be a remedy in this case, but what if don't have it (see 2)?

-- 
Timur Sufiev


-- 
Timur Sufiev
Next: Peter Krefting
Message 1 of 2 in “Timur Sufiev: Re: [PATCH I18N filenames v2 3/3] Provide compatibility with MinGW”
  1. Timur SufievNov 6, 2009
  2. Peter KreftingNov 6, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.