code: def ruencode(string, extension=False):
      
      if extension:
          file_name = string
          file_ext = ''
      else:
          file_name, file_ext = splitext(string)
  
      encoded_value, _ = _ROT_UNICODE.encode(file_name)
      return encoded_value + file_ext
docs: Encode a string using 'rotunicode' codec.
  
      :param string:
          The input string to encode.
      :type string:
          `basestring`
  
      :param extension:
          True if the entire input string should be encoded.
          False to split the input string using :func:`os.path.splitext` and
          encode only the file name portion keeping the extension as is.
      :type extension:
          `bool`
  
      :return:
          Encoded string.
      :rtype:
          `unicode`