I found that for all practical purposes MongoDB can be installed on a unix server of any locale (English, Spanish, Chinese, whatever) without changing behaviour. Except for the following two points:
- There are 3 case-related aggregation functions that use the (g)libc `tolower`, `toupper`, `strcasecmp` functions.
- strerr() output from (g)libc that is reprinted in error responses or in the log will be in the OS locale.
#2 is no big deal, it doesn't affect the correctness of the DB in any way.
But #1, by itself, ruins our ability to say "MongoDB can be installed on a server with any locale". I was originally pleasantly surprised to figure out how little effect locale could have on a mongod process, but I found that the user was just hearing "broken", "broken", "broken" when I explained there was this one exception.
I suggest that $strcasecmp, $toUpper and $toLower be changed to use the ICU equivalents instead of the libc functions, using simple case mapping / folding per http://userguide.icu-project.org/transforms/casemappings.