fix locale and country up/downcase handling
fix tests