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

Re: [PATCH 2/4] Do attempt pretty print in ASCII-incompatible encodings

From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Date
Feb 22, 2012, 02:17 UTC
Message-ID
<CACsJy8AJBzZnkKSVYRuwO2T1XEWp+N1HEfiir0oWPpo0vron-A@mail.gmail.com>
In-Reply-To
<20120221182118.GA32668@sigill.intra.peff.net>
2012/2/22 Jeff King <peff@peff.net>:
Show 18 quoted lines
> On Tue, Feb 21, 2012 at 09:24:50PM +0700, Nguyen Thai Ngoc Duy wrote:
>
>> We rely on ASCII everywhere. We print "\n" directly without conversion
>> for example. The end result would be a mix of some encoding and ASCII
>> if they are incompatible. Do not do that.
>>
>> In theory we could convert everything to utf-8 as intermediate medium,
>> process process process, then convert final output to the desired
>> encoding. But that's a lot of work (unless we have a pager-like
>> converter) with little real use. Users can just pipe everything to
>> iconv instead.
>
> I'm not sure why we bother checking this. Using non-ASCII-superset
> encodings is broken, yes, but are people actually doing that? I assume
> that the common one is utf-16, and anybody using it will experience
> severe breakage immediately. So are people actually doing this? Are
> there actually encodings that will cause subtle breakage that we want to
> catch?

I did :-) once actually. But that's a good point, using unsuitable encoding leads to garbage output, but no subtle breakage there. It'd be nice to say "your encoding is not supported" than throw garbage, but again probably no one did it but me, and I don't feel like doing it again.

-- 
Duy
Previous: Jeff KingNext: Peter Krefting
Message 5 of 12 in “t3900: add missing UTF-16.txt and mark the test successful”
  1. 1/4 t3900: add missing UTF-16.txt and mark the test successfulNguyễn Thái Ngọc Duy, Feb 21, 2012
  2. 2/4 Do attempt pretty print in ASCII-incompatible encodingsNguyễn Thái Ngọc Duy, Feb 21, 2012
  3. Nguyen Thai Ngoc DuyFeb 21, 2012
  4. Jeff KingFeb 21, 2012
  5. Nguyen Thai Ngoc DuyFeb 22, 2012
  6. Peter KreftingFeb 23, 2012
  7. 3/4 utf8: die if failed to re-encodingNguyễn Thái Ngọc Duy, Feb 21, 2012
  8. Junio C HamanoFeb 21, 2012
  9. 4/4 Only re-encode certain parts in commit object, not the wholeNguyễn Thái Ngọc Duy, Feb 21, 2012
  10. Jeff KingFeb 21, 2012
  11. Nguyen Thai Ngoc DuyFeb 22, 2012
  12. Junio C HamanoFeb 22, 2012

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.