def needsquoting(c, quotetabs, header):
if c in '<STR_LIT>':<EOL><INDENT>return quotetabs<EOL><DEDENT>if c == '<STR_LIT:_>':<EOL><INDENT>return header<EOL><DEDENT>return c == ESCAPE or not ('<STR_LIT:U+0020>' <= c <= '<STR_LIT>')<EOL>
Decide whether a particular character needs to be quoted.

    The 'quotetabs' flag indicates whether embedded tabs and spaces should be
    quoted.  Note that line-ending tabs and spaces are always encoded, as per
    RFC 1521.