ext/json/ext/generator/unicode.c in json_pure-1.1.9 vs ext/json/ext/generator/unicode.c in json_pure-1.2.0
- old
+ new
@@ -111,11 +111,11 @@
rb_raise(rb_path2class("JSON::GeneratorError"),
"partial character in source, but hit end");
}
if (!isLegalUTF8(source, extraBytesToRead+1)) {
rb_raise(rb_path2class("JSON::GeneratorError"),
- "source sequence is illegal/malformed");
+ "source sequence is illegal/malformed utf-8");
}
/*
* The cases all fall through. See "Note A" below.
*/
switch (extraBytesToRead) {
@@ -132,11 +132,11 @@
/* UTF-16 surrogate values are illegal in UTF-32 */
if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) {
if (flags == strictConversion) {
source -= (extraBytesToRead+1); /* return to the illegal value itself */
rb_raise(rb_path2class("JSON::GeneratorError"),
- "source sequence is illegal/malformed");
+ "source sequence is illegal/malformed utf-8");
} else {
unicode_escape(buffer, UNI_REPLACEMENT_CHAR);
}
} else {
/* normal case */
@@ -164,10 +164,10 @@
}
} else if (ch > UNI_MAX_UTF16) {
if (flags == strictConversion) {
source -= (extraBytesToRead+1); /* return to the start */
rb_raise(rb_path2class("JSON::GeneratorError"),
- "source sequence is illegal/malformed");
+ "source sequence is illegal/malformed utf8");
} else {
unicode_escape(buffer, UNI_REPLACEMENT_CHAR);
}
} else {
/* target is a character in range 0xFFFF - 0x10FFFF. */