The reason for the crash is indeed a locale setting that command-not-found cannot handle, e.g.
LC_CTYPE = "UTF-8" (which may be introduce, for example, via ssh from Mac OS X Lion).
Fixing the locale (e.g., unset LC_CTYPE) is a workaround,
but actually the instability in command-not-found causing the crash should be fixed.
The reason for the crash is indeed a locale setting that command-not-found cannot handle, e.g.
LC_CTYPE = "UTF-8" (which may be introduce, for example, via ssh from Mac OS X Lion).
Fixing the locale (e.g., unset LC_CTYPE) is a workaround,
but actually the instability in command-not-found causing the crash should be fixed.