From a981f560b6bd1f6e2f67a230e6a0ff8b4fc0d66f Mon Sep 17 00:00:00 2001 From: Mickey Rose Date: Tue, 15 Mar 2016 00:29:17 +0100 Subject: [PATCH] fix empty string value::to_expresssion_string --- src/value.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/value.cpp b/src/value.cpp index efcd15b5f..a3c8770cc 100644 --- a/src/value.cpp +++ b/src/value.cpp @@ -761,6 +761,13 @@ struct to_expression_string_impl std::string operator()(value_unicode_string const& val) const { + // toUTF8(sink) doesn't Flush() the sink if the source string + // is empty -- we must return a pair of quotes in that case + // https://github.com/mapnik/mapnik/issues/3362 + if (val.isEmpty()) + { + return std::string(2, quote_); + } EscapingByteSink sink(quote_); val.toUTF8(sink); return sink.dest_;