278 |
|
|
279 |
*characters = xnew(jschar, num_bytes); |
*characters = xnew(jschar, num_bytes); |
280 |
|
|
281 |
int result = MultiByteToWideChar(code_page, 0, bytes, num_bytes, *characters, num_bytes); |
int result = MultiByteToWideChar(code_page, MB_ERR_INVALID_CHARS, bytes, num_bytes, *characters, num_bytes); |
282 |
if (result == 0) { |
if (result == 0) { |
283 |
free(*characters); |
free(*characters); |
284 |
return JSCOVERAGE_ERROR_INVALID_BYTE_SEQUENCE; |
return JSCOVERAGE_ERROR_INVALID_BYTE_SEQUENCE; |
300 |
|
|
301 |
jschar * c = xnew(jschar, num_bytes); |
jschar * c = xnew(jschar, num_bytes); |
302 |
for (size_t i = 0; i < num_bytes; i++) { |
for (size_t i = 0; i < num_bytes; i++) { |
303 |
if (bytes[i]) > 127) { |
if (bytes[i] > 127) { |
304 |
free(c); |
free(c); |
305 |
return JSCOVERAGE_ERROR_ENCODING_NOT_SUPPORTED; |
return JSCOVERAGE_ERROR_ENCODING_NOT_SUPPORTED; |
306 |
} |
} |