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

Re: [PATCH 2/2] send-email: rfc2047-quote subject lines with non-ascii characters

From
Robin Rosenberg <robin.rosenberg.lists@dewire.com>
Date
Mar 29, 2008, 12:54 UTC
Message-ID
<200803291354.10368.robin.rosenberg.lists@dewire.com>
In-Reply-To
<20080329095238.GB21814@coredump.intra.peff.net>
Den Saturday 29 March 2008 10.52.38 skrev Jeff King:
Show 13 quoted lines
> On Sat, Mar 29, 2008 at 10:38:48AM +0100, Robin Rosenberg wrote:
> > The environment variables are only part of the story. There is a langinfo
> > API for this. See I18N::Langinfo(3pm) that knows about those and
> > something else.
> >
> > # perl -e 'require I18N::Langinfo; I18N::Langinfo->import(qw(langinfo
> > CODESET)); $codeset = langinfo(CODESET()); print "My codeset=".
> > $codeset."\n";'
> > My codeset=ISO-8859-15
>
> Hmm, neat. So perhaps it would make sense to just use this value instead
> of utf-8, and not worry about examining the actual text (since any such
> examination is at best a guess, anyway)?

I think you really should try the UTF-8 guess, since a file may well be UTF-8 even if the user locale is something else. Especially for XML files, UTF-8 is common, but there are many more cases. Look into git-gui/po for more examples. The probability of a UTF-8 test being wrong is just so unimaginable low.

> PS Your 'require' is more simply written as 'use I18N::Langinfo
> qw(langinfo CODESET)', or perhaps even simpler:

See the man page, from which I stole it. It suggests you wrap it all inside eval {}, just in case your perl does not have langinfo.

As for the is_utf8() i'm not sure what it does, but I can't make it work.
-- robin
Previous: Jeff KingNext: Jeff King
Message 25 of 32 in “[ANNOUNCE] GIT 1.5.5-rc2”
  1. Junio C HamanoMar 28, 2008
  2. Jeff KingMar 28, 2008
  3. Junio C HamanoMar 28, 2008
  4. Jeff KingMar 28, 2008
  5. Jeff KingMar 28, 2008
  6. 1/2 send-email: specify content-type of --compose bodyJeff King, Mar 28, 2008
  7. 2/2 send-email: rfc2047-quote subject lines with non-ascii charactersJeff King, Mar 28, 2008
  8. Robin RosenbergMar 29, 2008
  9. Jeff KingMar 29, 2008
  10. Robin RosenbergMar 29, 2008
  11. Jeff KingMar 29, 2008
  12. Robin RosenbergMar 29, 2008
  13. Jeff KingMar 29, 2008
  14. Robin RosenbergMar 29, 2008
  15. Jeff KingMar 29, 2008
  16. Robin RosenbergMar 29, 2008
  17. Jeff KingMar 29, 2008
  18. Sam VilainMar 30, 2008
  19. Jeff KingMar 30, 2008
  20. Junio C HamanoMar 30, 2008
  21. Robin RosenbergMar 29, 2008
  22. Jeff KingMar 29, 2008
  23. Robin RosenbergMar 29, 2008
  24. Jeff KingMar 29, 2008
  25. Robin RosenbergMar 29, 2008
  26. Jeff KingMar 29, 2008
  27. Robin RosenbergMar 29, 2008
  28. Jeff KingMar 29, 2008
  29. Sam VilainMar 30, 2008
  30. Jeff KingMar 30, 2008
  31. Junio C HamanoMay 21, 2008
  32. Jeff KingMay 21, 2008

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.