fixes #5869 - permit accents in user names on Ruby 1.8

Replaces #1387, uses a slightly stricter regex (more like the original) but adds tests based on the comments from that PR.