In particular: Are you happy treating them exactly the same way that Python's repr function does (basically, that means replacing the outer quotes with double quotes if that's sufficient, backslash-escaping quotes if not), or do you want different rules?
'character?reprfunction does (basically, that means replacing the outer quotes with double quotes if that's sufficient, backslash-escaping quotes if not), or do you want different rules?