Make matcher constant assignment more robust.

JRuby and Rubinius apparently don't handle
non-ascii in const names.