# HG changeset patch # User Sam Lantinga # Date 1186897731 0 # Node ID 22342048bcb82996ced7a6a900c16fd92558dae5 # Parent bb67fd5ccfdb6318c56975589ef641250cac4470 Fixed crash if conversion fails. Use ISO name for Latin-1 diff -r bb67fd5ccfdb -r 22342048bcb8 src/events/SDL_keyboard.c --- a/src/events/SDL_keyboard.c Sun Aug 12 00:01:41 2007 +0000 +++ b/src/events/SDL_keyboard.c Sun Aug 12 05:48:51 2007 +0000 @@ -448,9 +448,11 @@ char *cvt; temp[0] = (char) key; temp[1] = '\0'; - cvt = SDL_iconv_string("UTF-8", "LATIN1", temp, 1); - SDL_strlcpy(temp, cvt, SDL_arraysize(temp)); - SDL_free(cvt); + cvt = SDL_iconv_string("UTF-8", "ISO-8859-1", temp, 1); + if (cvt) { + SDL_strlcpy(temp, cvt, SDL_arraysize(temp)); + SDL_free(cvt); + } keyname = temp; } else { keyname = "unknown key";