diff --git a/extras/Projucer/Source/Application/jucer_CommandLine.cpp b/extras/Projucer/Source/Application/jucer_CommandLine.cpp index 13c9ff0c86..8b480db961 100644 --- a/extras/Projucer/Source/Application/jucer_CommandLine.cpp +++ b/extras/Projucer/Source/Application/jucer_CommandLine.cpp @@ -541,8 +541,16 @@ namespace out << " String " << name << "; " << name; + auto escapeIfSingleQuote = [] (const String& s) -> String + { + if (s == "\'") + return "\\'"; + + return s; + }; + for (int i = 0; i < text.length(); ++i) - out << " << '" << String::charToString (text[i]) << "'"; + out << " << '" << escapeIfSingleQuote (String::charToString (text[i])) << "'"; out << ";" << preferredLineFeed; }