@@ -113,7 +113,7 @@ void JSON_convert_UTF8_to_JSON(VALUE buffer, VALUE string, ConversionFlags flags
113113 }
114114 if (!isLegalUTF8 (source , extraBytesToRead + 1 )) {
115115 rb_raise (rb_path2class ("JSON::GeneratorError" ),
116- "source sequence is illegal/malformed" );
116+ "source sequence is illegal/malformed utf-8 " );
117117 }
118118 /*
119119 * The cases all fall through. See "Note A" below.
@@ -134,7 +134,7 @@ void JSON_convert_UTF8_to_JSON(VALUE buffer, VALUE string, ConversionFlags flags
134134 if (flags == strictConversion ) {
135135 source -= (extraBytesToRead + 1 ); /* return to the illegal value itself */
136136 rb_raise (rb_path2class ("JSON::GeneratorError" ),
137- "source sequence is illegal/malformed" );
137+ "source sequence is illegal/malformed utf-8 " );
138138 } else {
139139 unicode_escape (buffer , UNI_REPLACEMENT_CHAR );
140140 }
@@ -166,7 +166,7 @@ void JSON_convert_UTF8_to_JSON(VALUE buffer, VALUE string, ConversionFlags flags
166166 if (flags == strictConversion ) {
167167 source -= (extraBytesToRead + 1 ); /* return to the start */
168168 rb_raise (rb_path2class ("JSON::GeneratorError" ),
169- "source sequence is illegal/malformed" );
169+ "source sequence is illegal/malformed utf8 " );
170170 } else {
171171 unicode_escape (buffer , UNI_REPLACEMENT_CHAR );
172172 }
0 commit comments