Ticket #3159: mythmusic_idencoding.diff

File mythmusic_idencoding.diff, 2.0 KB (added by stuartm, 14 years ago)
  • mythmusic/metaioid3v2.cpp

     
    542545    if (NULL == p_frame)
    543546      return false;
    544547
     548    QString prefencoding = gContext->GetSetting("MusicTagEncoding");
     549    enum id3_field_textencoding encoding = ID3_FIELD_TEXTENCODING_UTF_16;
     550
     551    if (prefencoding == "ascii")
     552    {
     553        encoding = ID3_FIELD_TEXTENCODING_ISO_8859_1;
     554    }
     555    else if (prefencoding == "utf8")
     556    {
     557        encoding = ID3_FIELD_TEXTENCODING_UTF_8;
     558    }
     559
    545560    if (id3_field_settextencoding(&p_frame->fields[0],
    546                                   ID3_FIELD_TEXTENCODING_UTF_16) != 0)
     561                                  encoding) != 0)
    547562    {
    548563        id3_frame_delete(p_frame);
    549564        return false;
  • mythmusic/globalsettings.cpp

     
    115115    return gc;
    116116};
    117117
     118static HostComboBox *TagEncoding()
     119{
     120    HostComboBox *gc = new HostComboBox("MusicTagEncoding");
     121    gc->setLabel(QObject::tr("Tag Encoding"));
     122    gc->addSelection(QObject::tr("UTF-16"), "utf16");
     123    gc->addSelection(QObject::tr("UTF-8"), "utf8");
     124    gc->addSelection(QObject::tr("Ascii"), "ascii");
     125    gc->setHelpText(QObject::tr("Some mp3 players don't understand tags encoded in UTF8 or UTF16, this setting allows you to change the encoding format used. Currently applies only to ID3 tags."));
     126    return gc;
     127};
     128
    118129static HostCheckBox *AutoLookupCD()
    119130{
    120131    HostCheckBox *gc = new HostCheckBox("AutoLookupCD");
     
    514525    general->addChild(TreeLevels());
    515526    general->addChild(NonID3FileNameFormat());
    516527    general->addChild(IgnoreID3Tags());
     528    general->addChild(TagEncoding());
    517529    general->addChild(AutoLookupCD());
    518530    general->addChild(AutoPlayCD());
    519531    general->addChild(KeyboardAccelerators());