You'd actually want to handle UNICODE strings, not ASCII. https://docs.djangoproject.com/en/4.0/ref/unicode/
On Thursday, April 28, 2022 at 7:02:49 PM UTC-5 Thiago Luiz Parolin wrote: > Hi, > i have a model with 2 charfields for givenname, surname: > > nome = models.CharField( > max_length=150, > verbose_name=_("Nome"), > default='' > ) > sobrenome = models.CharField( > max_length=150, > verbose_name=_("Sobrenome"), > default='' > ) > > My modelForm does nothing, just defines a model at Meta with all fields. > My CreateView is just defined with all default values, not overriding > anything. > When submitting the form, the server returns 500 if 'nome' or 'sobrenome' > fields have accent letters like Á, é, í, ç. etc. > > The error: > 'ascii' codec can't encode character '\xe9' in position 4: ordinal not in > range(128) > with character depending on user input. > > I am using sqlite for db and the pragma encoding returns utf8. > > I don't know how to deal with it. > Any help would be appreciated. > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/bed1cb7c-6442-4ec7-b137-9c235e828d25n%40googlegroups.com.