code: def _fixStringValue(s, p):
      
  
      # pylint: disable=too-many-branches
      s = s[1:-1]
      rv = ''
      esc = False
      i = -1
      while i < len(s) - 1:
          i += 1
          ch = s[i]
          if ch == '\\' and not esc:
              esc = True
              continue
          if not esc:
              rv += ch
              continue
  
          if ch == '"':
              rv += '"'
          elif ch == 'n':
              rv += '\n'
          elif ch == 't':
              rv += '\t'
          elif ch == 'b':
              rv += '\b'
          elif ch == 'f':
              rv += '\f'
          elif ch == 'r':
              rv += '\r'
          elif ch == '\\':
              rv += '\\'
          elif ch in ['x', 'X']:
              hexc = 0
              j = 0
              i += 1
              while j < 4:
                  c = s[i + j]
                  c = c.upper()
                  if not c.isdigit() and c not in 'ABCDEF':
                      break
                  hexc <<= 4
                  if c.isdigit():
                      hexc |= ord(c) - ord('0')
                  else:
                      hexc |= ord(c) - ord('A') + 0XA
                  j += 1
              if j == 0:
                  # DSP0004 requires 1..4 hex chars - we have 0
                  raise MOFParseError(
                      parser_token=p,
                      msg="Unicode escape sequence (e.g. '\\x12AB') requires "
                          "at least one hex character")
              rv += six.unichr(hexc)
              i += j - 1
  
          esc = False
  
      return rv
docs: Clean up string value including special characters, etc.