CUDA for Linux local installer script crashes with non-default locale

The local installer for CUDA 10.1 (also older versions) from here:

Crashes on Fedora 29 and on CentOS 7 systems, if the locale (environment variable LANG) is not the default.

$ echo $LANG
$ sudo sh
terminate called after throwing an instance of 'std::out_of_range'
  what():  basic_string::substr: __pos (which is 9) > this->size() (which is 8)

The workaround is to set the LANG environment variable to the value C, then the installation succeeds.

export LANG=C

Do not work for me on Slackware 14.2 but same error.

Any else Ideas?