/[jscoverage]/trunk/encoding.c
ViewVC logotype

Diff of /trunk/encoding.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 188 by siliconforks, Tue Sep 23 03:48:15 2008 UTC revision 313 by siliconforks, Mon Oct 13 17:52:20 2008 UTC
# Line 22  Line 22 
22  #include "encoding.h"  #include "encoding.h"
23    
24  #include <assert.h>  #include <assert.h>
25    #include <limits.h>
26  #include <string.h>  #include <string.h>
27    
28  #ifdef HAVE_ICONV_H  #ifdef HAVE_ICONV_H
# Line 277  Line 278 
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;
# Line 299  Line 300 
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      }      }

Legend:
Removed from v.188  
changed lines
  Added in v.313

  ViewVC Help
Powered by ViewVC 1.1.24