diff options
author | miloyip <miloyip@gmail.com> | 2015-05-03 16:58:55 +0300 |
---|---|---|
committer | miloyip <miloyip@gmail.com> | 2015-05-03 16:58:55 +0300 |
commit | 524974deec46f437a2e46f490be556c802635774 (patch) | |
tree | 875e7cacbdf175efa9580a90c445501a141cd7fe /include/rapidjson/pointer.h | |
parent | c35d47f83cff9d254d1aefb450c840f957cfad13 (diff) |
Add Validation of UTF-8 sequence for percent encoding, also improves coverage
Diffstat (limited to 'include/rapidjson/pointer.h')
-rw-r--r-- | include/rapidjson/pointer.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/rapidjson/pointer.h b/include/rapidjson/pointer.h index cd685f0d..7ba51743 100644 --- a/include/rapidjson/pointer.h +++ b/include/rapidjson/pointer.h @@ -429,7 +429,7 @@ private: GenericInsituStringStream<EncodingType> os(name); Ch* begin = os.PutBegin(); Transcoder<UTF8<>, EncodingType> transcoder; - if (!transcoder.Transcode(is, os) || !is.IsValid()) { + if (!transcoder.Validate(is, os) || !is.IsValid()) { parseErrorCode_ = kPointerParseErrorInvalidPercentEncoding; goto error; } @@ -538,7 +538,7 @@ private: GenericStringStream<typename ValueType::EncodingType> source(&t->name[j]); PercentEncodeStream<OutputStream> target(os); Transcoder<EncodingType, UTF8<> > transcoder; - if (!transcoder.Transcode(source, target)) + if (!transcoder.Validate(source, target)) return false; j += source.Tell() - 1; } |