Opened 15 years ago
Closed 15 years ago
#5822 closed defect (duplicate)
mythmusic cannot see any files with accents or internationnal characters
Reported by: | Owned by: | Isaac Richards | |
---|---|---|---|
Priority: | critical | Milestone: | 0.22 |
Component: | mythmusic | Version: | head |
Severity: | medium | Keywords: | music scan characters accented |
Cc: | Ticket locked: | no |
Description
in the file mythmusic/mythmusic/filescanner.cpp the in function BuildFileList? the call to entryInfoList() returns only files that do not contain internationnal characters. A quick search shows that this is related to QT4. Something about the locale not being initialised, so QString::fromLocal8Bit does not work. this is in theory done in QCoreApplication but i do not see how this is acomplished in this plugin. This functions works corretly in 0.21
Change History (3)
Note: See
TracTickets for help on using
tickets.
Having never really programmed in Linux or QT, I began looking into this after upgrading to trunk (my wife has a lot of accented character songs).
Anyways after a little bit of playing with a stripped down QT console version of filescanner.cpp, I was able to hack this to work on my box by adding: QTextCodec::setCodecForLocale(QTextCodec::codecForName("ISO-8859-1")); at the beginning of the BuildFileList? function. After running the filescanner again it succesfully added and plays all the songs with special characters.
Playing with my program I noticed that if I don't call QCoreApplication a(argc, argv) prior to the entryInfoList call, it will not return files with accented characters, but by setting the codec it does work.
Also calling QTextCodec::codecForLocale().name() with or without QCoreApplication returns "System". after the setCodecForLocale it returns what I set it too. Haven't checked it in myth yet since I have been doing it remotely.
I'm going to look into this further and try to find a proper solution.