please see that it is python directive not django. for all sources it is a
good practive for all we that use pt-br utf-8 explicit this on second line
of file python code

# -*- coding: utf-8 -*-

regards!




2014/1/21 Henrique Romano <chrom...@gmail.com>

> Hi,
>
> As per the documentation[1], it is not clear that you _must_ use a unicode
> string for the language name.  If you don't use an unicode string, the
> following can happen:
>
> >>> from django.utils.translation import ugettext
> >>> ugettext("Português")
> Traceback (most recent call last):
> ...
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 7:
> ordinal not in range(128)
>
> As opposed to:
>
> >>> ugettext(u"Português")
> u'Portugu\xeas'
>
> I was just having an issue where the languages available was being
> rendered in the template, but since TEMPLATE_DEBUG was enabled, no errors
> was generated in the development environment.  Switching TEMPLATE_DEBUG off
> in the production resulted in an exception with almost no clue on what
> happened.
>
> What do you guys think about making it clear that the user should always
> use an unicode string for the LANGUAGES setting?
>
> [1] https://docs.djangoproject.com/en/dev/ref/settings/#languages
> --
> Henrique Romano
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to django-developers@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/CA%2BEHudKfPXxry6T2tW_6ZNFzJgAJUHs3nO_mLkdp3Xk2wS09xg%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
gilberto dos santos alves
+55.11.98646-5049
sao paulo - sp - brasil

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAP9G-NLKRTiyM_P-1aMR2dKZh%3DgNU_0s6GYGoXLO%2BjmzZYnsCw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to