better handling of locale
* fix Debian#768217 (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=768217)