November 2011

Umlauts on a US Keyboard (QWERTY)

I always have a hard time remembering how to set the keyboard shortcuts for umlauts on GNU/Linux.

Use the runtime utility setxkbmap:
setxkbmap -option "compose:lwin"

So now (+ just means "and then press" in this context):

Keys to press Character that you get
win+s+s ß
win+a+" ä
win+shift+a+" Ä
win+u+" ü
win+shift+u+" Ü
win+o+" ö
win+shift+u+" Ö

Also don't forget to set ctrl+alt+backspace back to a sane setting with:
setxkbmap -option "terminate:ctrl_alt_bksp"

php's string escape code for ESC (ascii 27) - \e

Tagged:  

I just came across phpsadness.com. In one of the entries the author notes:

PHP has no shorthand escape code for the Escape character; it is usually \e.
See: php language.types.string#language.types.string.syntax.double
It does have octal (\033) and hex (\x1b) escape codes for it, but these become especially cumbersome when doing things like ANSI escape sequences to control the color of output in your terminal, where the clarity of the sequences is important and even a few extra characters increases the line noise significantly.

I decided to go ahead and add it myself: https://bugs.php.net/bug.php?id=60350
Patch, documentation update and testcase all submitted.