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

Diff of /trunk/encoding.c

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

revision 187 by siliconforks, Sun Sep 21 18:33:41 2008 UTC revision 188 by siliconforks, Tue Sep 23 03:48:15 2008 UTC
# Line 60  Line 60 
60  #ifdef HAVE_ICONV  #ifdef HAVE_ICONV
61    
62  #ifdef WORDS_BIGENDIAN  #ifdef WORDS_BIGENDIAN
63  #define UCS_2_INTERNAL "UCS-2BE"  #define UTF_16_INTERNAL "UTF-16BE"
64  #else  #else
65  #define UCS_2_INTERNAL "UCS-2LE"  #define UTF_16_INTERNAL "UTF-16LE"
66  #endif  #endif
67    
68  int jscoverage_bytes_to_characters(const char * encoding, const uint8_t * bytes, size_t num_bytes, jschar ** characters, size_t * num_characters) {  int jscoverage_bytes_to_characters(const char * encoding, const uint8_t * bytes, size_t num_bytes, jschar ** characters, size_t * num_characters) {
69    assert(encoding != NULL);    assert(encoding != NULL);
70    
71    iconv_t state = iconv_open(UCS_2_INTERNAL, encoding);    iconv_t state = iconv_open(UTF_16_INTERNAL, encoding);
72    if (state == (iconv_t) -1) {    if (state == (iconv_t) -1) {
73      return JSCOVERAGE_ERROR_ENCODING_NOT_SUPPORTED;      return JSCOVERAGE_ERROR_ENCODING_NOT_SUPPORTED;
74    }    }

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

  ViewVC Help
Powered by ViewVC 1.1.24