Also see how the go guys do it https://code.google.com/p/go/source/browse/?repo=text#hg%2Funicode%2Fnorm