[mythtv-commits] Ticket #10371: mythcommandlineparser / mytharchivehelper fails on files with non-ascii-filenames

MythTV noreply at mythtv.org
Sat Feb 25 08:44:05 UTC 2012

#10371: mythcommandlineparser / mytharchivehelper fails on files with non-ascii-
 Reporter:  t.brackertz@…         |          Owner:  wagnerrp
     Type:  Bug Report - General  |         Status:  closed
 Priority:  minor                 |      Milestone:  0.25
Component:  MythTV - General      |        Version:  Master Head
 Severity:  medium                |     Resolution:  fixed
 Keywords:                        |  Ticket locked:  0

Comment (by wagnerrp):

 Replying to [comment:6 t.brackertz@…]:>
 > If so mythcommandlineparser could check if there is a QApplication-
 Object using QCoreApplication::instance () and only do
 QString::fromLocal8Bit if not.

 Very close, but not quite there.  ::fromLocal8Bit() does whatever text
 encoding is proper for that system, but until QApplication is available,
 it defaults to ::fromAscii().  For your specific case, the text must be
 processed using ::fromUtf8, but we don't know that until the QApplication
 is initialized and selects the proper locale.

 So the options are:
 * Duplicate the Qt code for determining the proper locale, but that
 becomes a nuisance to independently maintain.
 * Perform all command line parsing after QApplication has done its thing,
 but lose out on whatever arguments QApplication has stripped out of the
  * or feed it empty arrays
  * or make a copy of those arrays before hand
 * Do what the above patch does, storing those parsed values as QByteArrays
 until QApplication is available, and delay the handling of text encoding
 until the strings are actually needed.

Ticket URL: <http://code.mythtv.org/trac/ticket/10371#comment:8>
MythTV <http://code.mythtv.org/trac>
MythTV Media Center

More information about the mythtv-commits mailing list