Don't truncate multi-byte characters in json output (#428)

don't truncate multi-byte characters in json output
This commit is contained in:
Ryan Clark
2026-11-16 16:54:24 -07:00
committed by GitHub
parent 4f2621186a
commit a888304b19
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -12,6 +12,7 @@
#include <errno.h>
#include "geojson-loop.hpp"
#include "jsonpull/jsonpull.h"
#include "text.hpp"
// XXX duplicated
#define GEOM_TYPES 6
@@ -29,7 +30,7 @@ static void json_context(json_object *j) {
std::string s = json_stringify(j);
if (s.size() >= 500) {
s.resize(497);
s = truncate_string(s, 497);
s.append("...");
}
+1 -1
View File
@@ -46,7 +46,7 @@ void json_context(json_object *j) {
std::string s = json_stringify(j);
if (s.size() >= 500) {
s.resize(497);
s = truncate_string(s, 497);
s.append("...");
}