docs: def gb2312_to_euc(gb2312hex):
      """
      Convert GB2312-1980 hex (internal representation) to EUC-CN hex (the
      "external encoding")
      """
      hi, lo = int(gb2312hex[:2], 16), int(gb2312hex[2:], 16)
      hi, lo = hexd(hi + 0x80), hexd(lo + 0x80)
  
      euc = "%s%s" % (hi, lo)
      assert isinstance(euc, bytes)
      return euc