Skip to content

Commit

Permalink
Adding missing UCS-2-INTERNAL encoding as an alias of UCS2. Ceretain …
Browse files Browse the repository at this point in the history
…windows installations report their encoding as UCS-2-INTERNAL, which was causing SDL initialization failure when using cygwin's mingw64_64-w64-win-iconv libraries
  • Loading branch information
Saul Beniquez committed Mar 18, 2016
1 parent 1c57d6f commit 8c23784
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions win_iconv.c
Expand Up @@ -165,6 +165,7 @@ static struct {
{1200, "UTF-16LE"},
{1200, "UCS2LE"},
{1200, "UCS-2LE"},
{1200, "UCS-2-INTERNAL"},

{1201, "CP1201"},
{1201, "UTF16BE"},
Expand Down Expand Up @@ -952,7 +953,8 @@ make_csconv(const char *_name, csconv_t *cv)
cv->mbtowc = utf16_mbtowc;
cv->wctomb = utf16_wctomb;
if (_stricmp(name, "UTF-16") == 0 || _stricmp(name, "UTF16") == 0 ||
_stricmp(name, "UCS-2") == 0 || _stricmp(name, "UCS2") == 0)
_stricmp(name, "UCS-2") == 0 || _stricmp(name, "UCS2") == 0 ||
_stricmp(name,"UCS-2-INTERNAL") == 0)
cv->flags |= FLAG_USE_BOM;
}
else if (cv->codepage == 12000 || cv->codepage == 12001)
Expand Down Expand Up @@ -1574,7 +1576,7 @@ static int
utf32_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize)
{
int codepage = cv->codepage;
uint wc = 0xD800;
uint wc = 0xD800;

/* swap endian: 12000 <-> 12001 */
if (cv->mode & UNICODE_MODE_SWAPPED)
Expand Down

0 comments on commit 8c23784

Please sign in to comment.