New answers tagged

0

By "tty1", you mean a Linux virtual console. The unexpected characters in the error message from mv are the separate bytes of UTF-8 encoding, but printed when UTF-8 mode is not turned on. For instance, È is octal 200, the second byte of UTF-8 for both U+2018 and U+2019. The Linux console can be switched into UTF-8 mode with an escape sequence, or using ...


0

As far as I can tell, OS X uses code point collation order in UTF-8 locales, so it is an exception to some of the points mentioned in the answer by Stéphane Chazelas. This prints 26 in OS X and 310 in Ubuntu: export LC_ALL=en_US.UTF-8 printf %b $(printf '\\U%08x\\n' $(seq $((0x11)) $((0x10ffff))))|grep -a '[a-z]'|wc -l The code below prints nothing in ...


1

This works with OS X's tr but not with GNU tr: tr '[:lower:]' '[:upper:]' This works with gawk but not with mawk or nawk (which is /usr/bin/awk in OS X): awk '{print toupper($0)}' Another option is to use GNU sed: sed 's/./\u&/g' In Bash 4.0 and later you can also use the ^^ parameter expansion: while IFS= read -r l;do printf %s\\n ...


0

you are using a wrong order: export=en_US.utf-8 this should be: export LC_ALL=en_US.utf-8 or: export LANG=en_US.utf-8 Anyway, as the Debian wiki says, the use of LC_ALL is discouraged as it only lasts while session (i.e: an open terminal session). You could add it to a startup script, but this is discouraged again by Debian's wiki. If you just want ...


2

sudo sanitizes environment before running any command, so unless you save the desired environment variable in /etc/sudoers using env_keep the varible will not be preserved by sudo. Alternately, for a single command, you can do: sudo LANG=en_US.UTF-8 some_command In order to preserve the current environment: sudo -E some_command



Top 50 recent answers are included