'Set a sheet title, ensuring it is valid.
Limited to 31 characters, no special characters.'

@title.setter
def title(self, value):

    if hasattr(value, 'decode'):
        if (not isinstance(value, unicode)):
            try:
                value = value.decode('ascii')
            except UnicodeDecodeError:
                raise ValueError('Worksheet    titles    must    be    unicode')
    if self.bad_title_char_re.search(value):
        msg = 'Invalid    character    found    in    sheet    title'
        raise SheetTitleException(msg)
    sheets = self._parent.get_sheet_names()
    if ((self.title is not None) and (self.title != value)):
        value = avoid_duplicate_name(sheets, value)
    if (len(value) > 31):
        msg = 'Maximum    31    characters    allowed    in    sheet    title'
        raise SheetTitleException(msg)
    self._title = value
