For ultimate escaping use: auto str = q"EOS Weeee I'm a string ""``'q{\ EOS"; Of course then you have to make sure 'EOS' is a unique name too. You could use some funky unicode character sequence for that, just to be sure. :p