fix empty string value::to_expresssion_string
This commit is contained in:
parent
344e62e7db
commit
a981f560b6
1 changed files with 7 additions and 0 deletions
|
@ -761,6 +761,13 @@ struct to_expression_string_impl
|
||||||
|
|
||||||
std::string operator()(value_unicode_string const& val) const
|
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_);
|
EscapingByteSink sink(quote_);
|
||||||
val.toUTF8(sink);
|
val.toUTF8(sink);
|
||||||
return sink.dest_;
|
return sink.dest_;
|
||||||
|
|
Loading…
Reference in a new issue