added function to encode username for URL (commented regex)

see issue #209 comment 2 (forgot reference to issue in commit)