diff --git a/include/rapidjson/document.h b/include/rapidjson/document.h index 17af92264..783479cb3 100644 --- a/include/rapidjson/document.h +++ b/include/rapidjson/document.h @@ -480,7 +480,7 @@ template struct TypeHelper > { typedef std::basic_string StringType; static bool Is(const ValueType& v) { return v.IsString(); } - static StringType Get(const ValueType& v) { return v.GetString(); } + static StringType Get(const ValueType& v) { return StringType(v.GetString(), v.GetStringLength()); } static ValueType& Set(ValueType& v, const StringType& data, typename ValueType::AllocatorType& a) { return v.SetString(data, a); } }; #endif