[mythtv-commits] Ticket #13340: Locale dependent dates in HTTP response

MythTV noreply at mythtv.org
Sun Oct 28 20:35:04 UTC 2018


#13340: Locale dependent dates in HTTP response
-------------------------------------+------------------------------
 Reporter:  pmhahn                   |          Owner:  cpinkham
     Type:  Bug Report - General     |         Status:  new
 Priority:  minor                    |      Milestone:  needs_triage
Component:  MythTV - HTTP Streaming  |        Version:  v29-fixes
 Severity:  medium                   |     Resolution:
 Keywords:  locale, http             |  Ticket locked:  0
-------------------------------------+------------------------------

Comment (by pmhahn):

 Trac reports an error when trying to attach the patch as a file, so here
 it is inline:
 {{{
 From aeda77dbd522caebab2715706f08b00ef1d0b312 Mon Sep 17 00:00:00 2001
 From: Philipp Matthias Hahn <pmhahn+mythtv at pmhahn.de>
 Date: Sun, 28 Oct 2018 20:45:59 +0100
 Subject: [PATCH] mythbase: Fix RFC 822 Date Formatting
 To: mythtv-dev at mythtv.org

 The RFC 822 date format should always use en_US locale for month and
 day names instead of whatever the system locale is.
 ---
  mythtv/libs/libmythbase/mythdate.cpp | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

 diff --git a/mythtv/libs/libmythbase/mythdate.cpp
 b/mythtv/libs/libmythbase/mythdate.cpp
 index 2e0f59de28..87cf899c91 100644
 --- a/mythtv/libs/libmythbase/mythdate.cpp
 +++ b/mythtv/libs/libmythbase/mythdate.cpp
 @@ -93,7 +93,7 @@ QString toString(const QDateTime &raw_dt, uint format)
          return datetime.toString(Qt::ISODate);

      if (format & MythDate::kRFC822) // RFC 822 - RFC 7231 Sect 7.1.1.1 -
 HTTP Date
 -        return datetime.toUTC().toString("ddd, dd MMM yyyy
 hh:mm:ss").append(" GMT");
 +        return QLocale::c().toString(datetime.toUTC(),
 QStringLiteral("ddd, dd MMM yyyy hh:mm:ss")).append(" GMT");

      if (format & kFilename)
          return datetime.toString("yyyyMMddhhmmss");
 --
 2.19.1
 }}}

-- 
Ticket URL: <https://code.mythtv.org/trac/ticket/13340#comment:1>
MythTV <http://www.mythtv.org>
MythTV Media Center


More information about the mythtv-commits mailing list