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

Re: [PATCH] am: invoke perl's strftime in C locale

From
Dmitry V. Levin <ldv@altlinux.org>
Date
Jan 15, 2013, 17:40 UTC
Message-ID
<20130115174015.GA7471@altlinux.org>
In-Reply-To
<20130115165058.GA29301@sigill.intra.peff.net>
On Tue, Jan 15, 2013 at 08:50:59AM -0800, Jeff King wrote:
Show 12 quoted lines
> On Tue, Jan 15, 2013 at 05:42:12PM +0100, Antoine Pelisse wrote:
> 
> > > This puts all of perl into the C locale, which would mean error messages
> > > from perl would be in English rather than the user's language. It
> > > probably isn't a big deal, because that snippet of perl is short and not
> > > likely to produce problems, but I wonder how hard it would be to set the
> > > locale just for the strftime call.
> > 
> > Maybe just setting LC_TIME to C would do ...
> 
> Yeah, that is a nice simple solution. Dmitry, does just setting LC_TIME
> fix the problem for you?

Just setting LC_TIME environment variable instead of LC_ALL would end up with unreliable solution because LC_ALL has the highest priority.

If keeping error messages from perl has the utmost importance, it could be achieved by - perl -M'POSIX qw(strftime)' -ne 'BEGIN { $subject = 0 } + perl -M'POSIX qw(strftime :locale_h)' -ne ' + BEGIN { setlocale(LC_TIME, "C"); $subject = 0 } but the little perl helper script we are talking about hardly worths so much efforts.

-- 
ldv
Previous: Jeff KingNext: Dmitry V. Levin
Message 7 of 13 in “am: invoke perl's strftime in C locale”
  1. am: invoke perl's strftime in C localeDmitry V. Levin, Jan 14, 2013
  2. Junio C HamanoJan 14, 2013
  3. am: invoke perl's strftime in C localeDmitry V. Levin, Jan 14, 2013
  4. Jeff KingJan 15, 2013
  5. Antoine PelisseJan 15, 2013
  6. Jeff KingJan 15, 2013
  7. Dmitry V. LevinJan 15, 2013
  8. am: invoke perl's strftime in C localeDmitry V. Levin, Jan 15, 2013
  9. Junio C HamanoJan 18, 2013
  10. Jeff KingJan 19, 2013
  11. Dmitry V. LevinJan 19, 2013
  12. Junio C HamanoJan 20, 2013
  13. Junio C HamanoJan 15, 2013

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.