diff --git a/lang/c++/impl/NodeImpl.cc b/lang/c++/impl/NodeImpl.cc index 01596a50579..fc5d9272ce3 100644 --- a/lang/c++/impl/NodeImpl.cc +++ b/lang/c++/impl/NodeImpl.cc @@ -47,7 +47,8 @@ string escape(const string &unescaped) { s += 'b'; break; case '\f': - s += '\f'; + s += '\\'; + s += 'f'; break; case '\n': s += '\\'; diff --git a/lang/c++/test/SchemaTests.cc b/lang/c++/test/SchemaTests.cc index 13fe0121d27..58ba874a29a 100644 --- a/lang/c++/test/SchemaTests.cc +++ b/lang/c++/test/SchemaTests.cc @@ -406,7 +406,7 @@ const char *schemasToCompact[] = { // Schema with whitespaces both inside and outside of field names/values. "{\"type\": \"record\", \"name\": \"ComplexInteger\"\n, " - "\"doc\": \"record_doc °C \u00f8 \x1f \\n \n \t\", " + "\"doc\": \"record_doc °C \u00f8 \x1f \\f \f \\n \n \t\", " "\"fields\": [" "{\"name\": \"re1\", \"type\": \"long\", " "\"doc\": \"A \\\"quoted doc\\\"\" }, " @@ -418,7 +418,7 @@ const char *compactSchemas[] = { R"({"type":"record","name":"Test","fields":[]})", R"({"type":"record","name":"Test","fields":[]})", "{\"type\":\"record\",\"name\":\"ComplexInteger\"," - "\"doc\":\"record_doc °C \u00f8 \\u001f \\n \\n \\t\"," + "\"doc\":\"record_doc °C \u00f8 \\u001f \\f \\f \\n \\n \\t\"," "\"fields\":[" "{\"name\":\"re1\",\"type\":\"long\",\"doc\":\"A \\\"quoted doc\\\"\"}," "{\"name\":\"re2\",\"type\":\"long\",\"doc\":\"extra slashes\\\\\\\\\"}"