Commit bb4c68f9 authored by Francis Dupont's avatar Francis Dupont
Browse files

[5101] Added an intermediate stream (CID 1398339)

parent 3db1edb0
// Copyright (C) 2010-2016 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2010-2017 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
......@@ -798,11 +798,13 @@ StringElement::toJSON(std::ostream& ss) const {
break;
default:
if ((c >= 0) && (c < 0x20)) {
ss << "\\u"
<< hex
<< setw(4)
<< setfill('0')
<< (static_cast<unsigned>(c) & 0xff);
std::ostringstream esc;
esc << "\\u"
<< hex
<< setw(4)
<< setfill('0')
<< (static_cast<unsigned>(c) & 0xff);
ss << esc.str();
} else {
ss << c;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment