Code Monkey home page Code Monkey logo

Comments (4)

shundhammer avatar shundhammer commented on May 13, 2024 1

In that Stack Overflow thread there was another, better readable solution (in particular better readable in the cleanup output window and in the log):

'Don't do this' -> 'Don'\''t do this'

Implemented with b08df9a.

from qdirstat.

shundhammer avatar shundhammer commented on May 13, 2024

QDirStat had always escaped such single quotes, but not the way common shells (Bash, Zsh) expect it: They don't want a backslash in front of that embedded single quote. Rather, you need to terminate the string with a single quote, start a new one with double quotes only containing the embedded single quote, and then re-open the old string.

Thus, 'Don't do this' becomes 'Don'"'"'t do this'.

Yikes. This is so utterly broken by design I can't find proper words for it. I just wonder how much other software is out there that does it the way most people would expect it: Trying to use a backslash to escape that embedded single quote ('Don\'t do this').

Of course, such file names should be avoided entirely, but you can't help some slightly broken MP3 ripper program doing it, so it needs to be handled correctly.

Fixed with c8da4e8.

from qdirstat.

shundhammer avatar shundhammer commented on May 13, 2024

As is the case so often, the answer was on Stack Overflow: http://stackoverflow.com/questions/1250079/how-to-escape-single-quotes-within-single-quoted-strings

from qdirstat.

Smile4ever avatar Smile4ever commented on May 13, 2024

I can confirm the fix works, thank you.

from qdirstat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.