Check return value of setlocale().

setlocale() is allowed to return NULL.  In particular, this happens on
Bionic (Android's libc) becuase it doesn't support C locales.