Commits

Connor Wakamo committed 725f501e9b6
Fixed the escaping of strings in swift::json::Output. Instead of using llvm::raw_ostream::write_escaped (which does not produce valid JSON strings), implemented custom escaping logic based on the JSON standard, which only requires that the following characters be escaped: - Quotation mark (U+0022) - Reverse solidus (U+005C) - Control characters (U+0000 to U+001F) Since these characters all fit within a single UTF8 byte, and will not be present in a multi-byte UTF8 representation, simply check whether the current byte needs to be escaped according to those requirements. If the current byte needs to be escaped, then print out the escaped version of the byte; otherwise, pass the current byte to the stream directly. This fixes <rdar://problem/18266570>. Swift SVN r21892