code: def __diff_str(self, level):
          
          if self.ignore_string_case:
              level.t1 = level.t1.lower()
              level.t2 = level.t2.lower()
  
          if type(level.t1) == type(level.t2) and level.t1 == level.t2:
              return
  
          # do we add a diff for convenience?
          do_diff = True
          t1_str = level.t1
          t2_str = level.t2
  
          if isinstance(level.t1, bytes_type):
              try:
                  t1_str = level.t1.decode('ascii')
              except UnicodeDecodeError:
                  do_diff = False
  
          if isinstance(level.t2, bytes_type):
              try:
                  t2_str = level.t2.decode('ascii')
              except UnicodeDecodeError:
                  do_diff = False
  
          if t1_str == t2_str:
              return
  
          if do_diff:
              if '\n' in t1_str or '\n' in t2_str:
                  diff = difflib.unified_diff(
                      t1_str.splitlines(), t2_str.splitlines(), lineterm='')
                  diff = list(diff)
                  if diff:
                      level.additional['diff'] = '\n'.join(diff)
  
          self.__report_result('values_changed', level)
docs: Compare strings