Should I be using Regex to uppercase uncommon characters? I've written a function for converting strings to upper case. It currently works by replacing each character using a Regex pattern with a hash:

# Special upcase function that handles several Norwegian symbols.
def norwegian_upcase(string)
    string.upcase.gsub(/[æøåäâãàáëêèéïîìíöôõòóüûùúý]/, {
        'æ' =&gt; 'Æ',
        'ø' =&gt; 'Ø',
        'å' =&gt; 'Å',
        'ä' =&gt; 'Ä',
        'â' =&gt; 'Â',
        'ã' =&gt; 'Ã',
        'à' =&gt; 'À',
        'á' =&gt; 'Á',
        'ë' =&gt; 'Ë',
        'ê' =&gt; 'Ê',
        'è' =&gt; 'È',
        'é' =&gt; 'É',
        'ï' =&gt; 'Ï',
        'î' =&gt; 'Î',
        'ì' =&gt; 'Ì',
        'í' =&gt; 'Í',
        'ö' =&gt; 'Ö',
        'ô' =&gt; 'Ô',
        'õ' =&gt; 'Õ',
        'ò' =&gt; 'Ò',
        'ó' =&gt; 'Ó',
        'ü' =&gt; 'Ü',
        'û' =&gt; 'Û',
        'ù' =&gt; 'Ù',
        'ú' =&gt; 'Ú',
        'ý' =&gt; 'Ý'
    })
end


I have the feeling that it's horribly inefficient to be using Regex like this, and that I should probably be using another method. Can anyone suggest a better way to replace single characters, or is Regex fit for the task?
One-to-one substitution is precisely what tr is for.

def norwegian_upcase(string)
  string.upcase.tr('æ-ý','Æ-Ý')
end


That being said, the unicode_utils gem provides a method for this:

def norwegian_upcase(string)
  UnicodeUtils.upcase(string, :no)
end


I don't know Norwegian, but you can supply language subtags :nb (Norwegian Bokmal) or :nn (Norwegian Nynorsk) if they would behave differently than general :no (Norwegian).