'Validation of a value
@param value: the value
@return: tuple (value, error), where error is None if value
is valid. With international=True, the value returned
is converted into E.123 international notation.'

def __call__(self, value):

    if isinstance(value, basestring):
        value = value.strip()
        if (value and (value[0] == unichr(8206))):
            value = value[1:]
        number = s3_str(value)
        (number, error) = s3_single_phone_requires(number)
    else:
        error = True
    if (not error):
        if (self.international and current.deployment_settings.get_msg_require_international_phone_numbers()):
            error_message = self.error_message
            if (not error_message):
                error_message = current.T('Enter    phone    number    in    international    format    like    +46783754957')
            number = ''.join(re.findall('[\\d+]+', number))
            match = re.match('(\\+)([1-9]\\d+)$', number)
            if match:
                number = ('+%s' % match.groups()[1])
                return (number, None)
        else:
            return (number, None)
    error_message = self.error_message
    if (not error_message):
        error_message = current.T('Enter    a    valid    phone    number')
    return (value, error_message)
