encode username; bug reported by @eagle5678