code: def _ostaunicode(src):
      # type: (str) -> bytes
      '''
      Internal function to create an OSTA byte string from a source string.
      '''
      if have_py_3:
          bytename = src
      else:
          bytename = src.decode('utf-8')  # type: ignore
  
      try:
          enc = bytename.encode('latin-1')
          encbyte = b'\x08'
      except (UnicodeEncodeError, UnicodeDecodeError):
          enc = bytename.encode('utf-16_be')
          encbyte = b'\x10'
      return encbyte + enf _ostaunicode(src):
      # type: (str) -> bytes
      '''
      Internal function to create an OSTA byte string from a source string.
      '''
      if have_py_3:
          bytename = src
      else:
          bytename = src.decode('utf-8')  # type: ignore
  
      try:
          enc = bytename.encode('latin-1')
          encbyte = b'\x08'
      except (UnicodeEncodeError, UnicodeDecodeError):
          enc = bytename.encode('utf-16_be')
          encbyte = b'\x10'
      return encbyte + enc
docs: Internal function to create an OSTA byte string from a source string.