def remove_accent_errors(exception): """ Implements the 'remove_accent' error handling (for encoding with text encodings only): the unencodable character is replaced by an character without accent (characters are converted to ASCII). """ chunk = exception.object[exception.start:exception.end] return remove_accent(chunk), exception.end
def get_anonymized_value(self, value): normalized_value = re.sub(r'[^A-Z ]', 'Q', remove_accent(value.strip()).upper()) normalized_key = (settings.ANONYMIZATION_NAME_KEY[i % len( settings.ANONYMIZATION_NAME_KEY)] for i in range(len(normalized_value))) return ''.join([ v if v == ' ' else self._number_to_char(self._char_to_number(v) + int(k)) for k, v in zip(normalized_key, normalized_value) ])
def clean_content(self): if not settings.SMS_USE_ACCENT: self.content = six.text_type( remove_accent(six.text_type(self.content)))
def ascii_content(self): return remove_accent(self.content).decode('utf-8')
def clean_content(self): if not config.ATS_USE_ACCENT: self.content = six.text_type(remove_accent(six.text_type(self.content)))
def test_should_remove_accent_from_string(self): assert_equal('escrzyaie', remove_accent('ěščřžýáíé'))
def ascii_content(self): return remove_accent(self.content)
def clean_content(self): if settings.OPERATOR_UNESCAPE_HTML: self.content = unescape(self.content) if not settings.USE_ACCENT: self.content = six.text_type( remove_accent(six.text_type(self.content)))
def get_name(self): return force_text(remove_accent(force_text(self.model._meta.verbose_name_plural)))
def get_name(self): return force_text( remove_accent(force_text(self.model._meta.verbose_name_plural)))
def clean_content(self): if not settings.SMS_USE_ACCENT: self.content = str(remove_accent(str(self.content)))