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

Re: [PATCH] Try URI quoting for embedded TAB and LF in pathnames

From
Linus Torvalds <torvalds@osdl.org>
Date
Oct 12, 2005, 14:59 UTC
Message-ID
<Pine.LNX.4.64.0510120749230.14597@g5.osdl.org>
In-Reply-To
<877jcjmdmq.fsf@penguin.cs.ucla.edu>
On Tue, 11 Oct 2005, Paul Eggert wrote:
Show 5 quoted lines
> 
> >  - any _raw_byte_ is in the 0x80-0x9f range (it might not be UTF-8)
> 
> Why quote the raw bytes?  Is this for terminal escapes on older xterm
> (or xterm-like) implementations that don't understand UTF-8?
It's not about "understanding" UTF-8.

Even a perfectly modern xterm may simply not be in UTF-8 mode: if it wasn't in an UTF-8 locale, then it won't do UTF-8 decoding.

> If so, I'm not sure I'd bother, as it would introduce a lot of annoying
> quoting with perfectly reasonable UTF-8, and (if we assume the world
> is moving to UTF-8) it addresses a problem that is going away.

UTF-8 is only _now_ getting really widespread, and I think it's because RedHat bit the bullet and made UTF-8 the default locale a few years ago.

These things take _decades_.

I don't know if you realize it, but it's only within the last couple of years that the old 7-bit "finnish ASCII" went away. Finnish and Swedish have three extra characters: åäö (latin1) and åäö (utf-8). But only within the last few years has the really _old_ ASCII representation really gone away so much that I don't see it at all (the characters '{' '}' and '|' were taken over, so that if you had a Finnish ASCII font, programming in C was really funky - but it was common enough that I could do it without thinking much about it ;)

So lots of people still use the byte-wide encodings. Whether really old ASCII only or some special locale-dependent one (of which latin1 and the "win-latin1" thing are obviously the most common by far). And in that locale, it's not the UTF-8 control characters that matter, it's the _byte_ control characters that do.

So if you want to support any other locale than UTF-8, you need to escape them. Assuming you want to escape control characters at all, of course (I still think it's perfectly fine to just let the raw mess through and depend on escaping at higher levels)

			Linus
Previous: Paul EggertNext: Daniel Barkalow
Message 17 of 33 in “[RFC] embedded TAB and LF in pathnames”
  1. Junio C HamanoOct 7, 2005
  2. Alex RiesenOct 7, 2005
  3. Junio C HamanoOct 7, 2005
  4. Alex RiesenOct 8, 2005
  5. Junio C HamanoOct 8, 2005
  6. Try URI quoting for embedded TAB and LF in pathnamesRobert Fitzsimons, Oct 8, 2005
  7. Junio C HamanoOct 8, 2005
  8. Junio C HamanoOct 8, 2005
  9. Paul EggertOct 11, 2005
  10. Junio C HamanoOct 11, 2005
  11. Linus TorvaldsOct 11, 2005
  12. Paul EggertOct 11, 2005
  13. Linus TorvaldsOct 11, 2005
  14. Paul EggertOct 11, 2005
  15. Linus TorvaldsOct 11, 2005
  16. Paul EggertOct 12, 2005
  17. Linus TorvaldsOct 12, 2005
  18. Daniel BarkalowOct 12, 2005
  19. Linus TorvaldsOct 12, 2005
  20. H. Peter AnvinOct 12, 2005
  21. Junio C HamanoOct 9, 2005
  22. Junio C HamanoOct 12, 2005
  23. Linus TorvaldsOct 12, 2005
  24. H. Peter AnvinOct 12, 2005
  25. Johannes SchindelinOct 12, 2005
  26. Junio C HamanoOct 12, 2005
  27. Paul EggertOct 14, 2005
  28. Linus TorvaldsOct 14, 2005
  29. Linus TorvaldsOct 12, 2005
  30. Paul EggertOct 14, 2005
  31. Linus TorvaldsOct 14, 2005
  32. H. Peter AnvinOct 14, 2005
  33. Junio C HamanoOct 14, 2005

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.