Don't quote if no encoding is needed.

This commit is contained in:
Vincent Richard 2010-02-10 09:41:36 +00:00
parent 5c2d078b4f
commit fa6c1dba06

View File

@ -357,7 +357,8 @@ void word::generate(utility::outputStream& os, const string::size_type maxLineLe
// - the whole buffer is ASCII-only
// - the buffer does not contain quoting character (")
// - there is enough remaining space on the current line to hold the whole buffer
if ((flags & text::QUOTE_IF_POSSIBLE) &&
if (!noEncoding &&
(flags & text::QUOTE_IF_POSSIBLE) &&
asciiCount == m_buffer.length() &&
m_buffer.find('"') == string::npos &&
(curLineLength + 2 /* 2 x " */ + m_buffer.length()) < maxLineLength)