Skip to content
  • Johannes Zarl-Zierl's avatar
    Fix bugfix in commit ac5370fb · 717d69a6
    Johannes Zarl-Zierl authored
    Fix regression introduced by d34534b5.
    Implementing a format string conversion for "%0X" correctly and in a
    backwards compatible mode has proven to be harder than I thought.
    So I opted to replace the deprecated QString::sprintf() with
    QString::asprintf(), which is not recommended for new code but not
    deprecated either.
    
    Note: if you ever reimplement this, check the following characters for
    compatibility:
    
     " " -> "_.20"
     "%" -> "_.25"
     "&" -> "_.26"
     "ä" -> "_.FFFFFFE4"
     "ö" -> "_.FFFFFFF6"
     "ü" -> "_.FFFFFFFC"
     "⌘" -> "_.0" //note: this is incorrect behaviour
     "\uD83D" -> "_.0" //note: this is incorrect behaviour
     "\uDE03" -> "_.0" //note: this is incorrect behaviour
    
    The incorrectly escaped characters won't be a problem immediately,
    because the attribute will be correctly mapped to the right category.
    This just means that all of the last three example characters will be
    mapped to the same string, leading to possible ambiguities.
    717d69a6