Skip to content

Commit

Permalink
test/checkkeys.c: fix watcom builds
Browse files Browse the repository at this point in the history
  • Loading branch information
sezero committed Sep 23, 2022
1 parent 92d3d71 commit 120e969
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/checkkeys.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,12 @@ static void PrintKey(SDL_keysym *sym, int pressed)
else
printf(" (0x%.4X)", (int)sym->unicode);
#else /* other platforms than Windows hopefully use UTF-8 for 8bit chars */
Uint32 utf32str[2] = { sym->unicode, 0 };
const char* utf32type = (SDL_BYTEORDER == SDL_LIL_ENDIAN) ? "UTF-32LE" : "UTF-32BE";
char* utf8str = SDL_iconv_string("UTF-8", utf32type, (const char*)utf32str, 2*4);
char* utf8str;
Uint32 utf32str[2];
utf32str[0] = sym->unicode;
utf32str[1] = 0;
utf8str = SDL_iconv_string("UTF-8", utf32type, (const char*)utf32str, 2*4);
printf(" '%s' (0x%.4X)", utf8str, (int)sym->unicode);
SDL_free(utf8str);
#endif
Expand Down

0 comments on commit 120e969

Please sign in to comment.