fix empty string value::to_expresssion_string

This commit is contained in:
Mickey Rose 2016-03-15 00:29:17 +01:00
parent 344e62e7db
commit a981f560b6

View file

@ -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_;