
noreply at mythtv
Apr 11, 2012, 1:50 AM
Post #16 of 20
(128 views)
Permalink
|
|
Re: Ticket #9797: Play Blu Ray from storage groups with directories whose names contain Cyrillic characters
[In reply to]
|
|
#9797: Play Blu Ray from storage groups with directories whose names contain Cyrillic characters ---------------------------------------+---------------------------- Reporter: sandybigboy@… | Owner: Type: Patch - Bug Fix | Status: new Priority: minor | Milestone: unknown Component: MythTV - Blu-ray Playback | Version: 0.24-fixes Severity: medium | Resolution: Keywords: | Ticket locked: 0 ---------------------------------------+---------------------------- Comment (by sandybigboy@…): I must say that I am not a programmer, but I did some experimenting and Google on this topic. It seems that replacing filename.toLatin1 () on filename.toLocal8Bit () in file BDRingBuffer.cpp (DVDRingBuffer.cpp in the file it is) we will solve the problem, but in reality it is not. As I understand the problem is that outside of the context object QApplication and QCoreApplication Qt does not know about local encoding. And in the code of BDRingBuffer.cpp and DVDRingBuffer.cpp this context is not exists, so we have to explicitly specify the encoding for strings with codecForName. Here's an example: QApplication app (argc, argv); setlocale (LC_ALL, ""); QTextCodec * vpCodec = QTextCodec :: codecForLocale (); if (vpCodec) { QTextCodec :: setCodecForCStrings (vpCodec); } const QString & filename = "привет!"; QString fn = filename.toLocal8Bit (). Data (); In this code, the value of variable fn will be appropriate encoding of the locale. In the code: QTextCodec * vpCodec = QTextCodec :: codecForLocale (); if (vpCodec) { QTextCodec :: setCodecForCStrings (vpCodec); } const QString & filename = "/ hello"; QString fn = filename.toLocal8Bit (). Data (); no object QApplication, Qt will use the default encoding, and our code will work only if we specify the codec with, for example QTextCodec :: codecForName ("UTF-8") Apologize for bad English, and perhaps not the correct terminology -- Ticket URL: <http://code.mythtv.org/trac/ticket/9797#comment:15> MythTV <http://code.mythtv.org/trac> MythTV Media Center _______________________________________________ mythtv-commits mailing list mythtv-commits [at] mythtv http://www.mythtv.org/mailman/listinfo/mythtv-commits
|