code: def convert_surrogate_pair(match):
      
      pair = match.group(0)
      codept = 0x10000 + (ord(pair[0]) - 0xd800) * 0x400 + (ord(pair[1]) - 0xdc00)
      return chr(codept)
docs: Convert a surrogate pair to the single codepoint it represents.
  
      This implements the formula described at:
      http://en.wikipedia.org/wiki/Universal_Character_Set_characters#Surrogates