Skip to content

Instantly share code, notes, and snippets.

@tsak
Last active October 23, 2020 14:55
Show Gist options
  • Save tsak/fdea62500d4f6da8bd6b0de9decb8fd6 to your computer and use it in GitHub Desktop.
Save tsak/fdea62500d4f6da8bd6b0de9decb8fd6 to your computer and use it in GitHub Desktop.
TIL that KDE silently replaces slashes in filenames with a fraction slash

TIL that KDE has a killer feature which will silently replace a / with a (fraction slash) when you go Right Click -> Create New -> Text file...

// See https://api.kde.org/frameworks/kio/html/global_8cpp_source.html#l00141
KIOCORE_EXPORT QString KIO::encodeFileName(const QString &_str)
{
    QString str(_str);
    str.replace(QLatin1Char('/'), QChar(0x2044)); // "Fraction slash"
    return str;
}

...which of course is super hard to spot and cost our new junior dev the whole day, trying to figure out why his code wasn't finding his test⁄test.txt in Azure's blob storage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment