Linode Lish bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)

Trial & error with different answers, I came up with this solution (on Lish while server is in rescue-mode): echo “LC_ALL=en_US.UTF-8” >> /etc/environment echo “en_US.UTF-8 UTF-8” >> /etc/locale.gen echo “LANG=en_US.UTF-8” > /etc/locale.conf locale-gen en_US.UTF-8 Last command resulted in the following error: locale-gen: command not found Here’s what you need to do (still on Lish): apt-get … Read more

How do I strftime a date object in a different locale? [duplicate]

The example given by Rob is great, but isn’t threadsafe. Here’s a version that works with threads: import locale import threading from datetime import datetime from contextlib import contextmanager LOCALE_LOCK = threading.Lock() @contextmanager def setlocale(name): with LOCALE_LOCK: saved = locale.setlocale(locale.LC_ALL) try: yield locale.setlocale(locale.LC_ALL, name) finally: locale.setlocale(locale.LC_ALL, saved) # Let’s set a non-US locale locale.setlocale(locale.LC_ALL, ‘de_DE.UTF-8’) … Read more

PHP setlocale has no effect

Is is quite likely that the German locale is not installed on the server your running the script on – do you have shell access to the server? Then try locale -a to see which locales are installed. Also have a look here Is it feasible to rely on setlocale, and rely on locales being … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)