61 /* Convert to UCS-4 */ |
61 /* Convert to UCS-4 */ |
62 ucs4 = SDL_iconv_string("UCS-4", "UTF-8", buffer, SDL_strlen(buffer)+1); |
62 ucs4 = SDL_iconv_string("UCS-4", "UTF-8", buffer, SDL_strlen(buffer)+1); |
63 size_t len = (widelen(ucs4)+1)*4; |
63 size_t len = (widelen(ucs4)+1)*4; |
64 for ( i = 0; i < SDL_arraysize(formats); ++i ) { |
64 for ( i = 0; i < SDL_arraysize(formats); ++i ) { |
65 if ( (SDL_strncasecmp(formats[i], "UTF16", 5) == 0 || |
65 if ( (SDL_strncasecmp(formats[i], "UTF16", 5) == 0 || |
66 SDL_strncasecmp(formats[i], "UTF-16", 6) == 0) && |
66 SDL_strncasecmp(formats[i], "UTF-16", 6) == 0 || |
67 !testutf16(ucs4) ) { |
67 SDL_strncasecmp(formats[i], "UTF32", 5) == 0 || |
|
68 SDL_strncasecmp(formats[i], "UTF-32", 6) == 0) && |
|
69 !testutf1632(ucs4) ) { |
68 continue; |
70 continue; |
69 } |
71 } |
70 test[0] = SDL_iconv_string(formats[i], "UCS-4", ucs4, len); |
72 test[0] = SDL_iconv_string(formats[i], "UCS-4", ucs4, len); |
71 test[1] = SDL_iconv_string("UCS-4", formats[i], test[0], len); |
73 test[1] = SDL_iconv_string("UCS-4", formats[i], test[0], len); |
72 if ( SDL_memcmp(test[1], ucs4, len) != 0 ) { |
74 if ( SDL_memcmp(test[1], ucs4, len) != 0 ) { |