Friday, June 28, 2013

Re: Django-admin-tools unicode problem


Hi,

I can perfectly understand Portuguese, but it's not the case for many users of this mailing list. Please, stick to English...

Cheers,

Roberto



On 06/28/2013 01:35 PM, Sandro Dutra wrote:
Como o Gilberto postou, pode haver um problema quando o teu editor de textos salva o arquivo do template, tente abrir este template pelo bloco de notas e ao 'salvar como' deve haver um campo lá embaixo para selecionar a 'Codificação', selecione UTF-8 e salve ou tente a configuração relativa no editor de textos que está a utilizar, talvez isto resolva o problema.

Eu já tive esses problemas quando usava Notepad++, mas tenho utilizado PyCharm e não tive mais este tipo de problema, há opções gratuitas que devem lidar com isto também, tais como Sublime e Aptana.


2013/6/27 Jaimerson Leandro Amaro de Araújo <jaimersonaraujo@gmail.com>
Cara, o problema é que a exceção tá sendo no template do aplicativo, que lê as informações do banco de dados. Alterar os arquivos do admin-tools é inviável em termos de portabilidade na hora do deploy. O que eu quero saber é se é possível mudar o encoding padrão desse app.

Em quarta-feira, 26 de junho de 2013 11h22min18s UTC-3, Odin escreveu:
Jaimerson, ainda assim creio que você deva tentar adicionar ao topo de suas views e/ou dos módulos usados do admin-tools a linha:

# -*- coding: utf-8 -*- ou # -*- coding: iso-8859-1 -*-

Isso permitirá ao Python ler o arquivo no encoding definido.


2013/6/26 Jaimerson Leandro Amaro de Araújo <jaimers...@gmail.com>

Uh, I know it`s an encoding problem, I was hoping there was a way of changing default charset for that app.

Em quarta-feira, 26 de junho de 2013 10h16min02s UTC-3, Odin escreveu:
Think it's an encode problem. I never use this app but try to add this line o top of your views file:

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


2013/6/26 Jaimerson Leandro Amaro de Araújo <jaimers...@gmail.com>
(I posted this on django-admin-tools mail list, but apparently there's no one alive there)


Hello, I'm stuck in a encoding issue, on the dashboard template. Some of my models have fields with non-ascii characters (like "à" or "á"), and when I try to load the page, I get the following error:

DjangoUnicodeDecodeError at /

'ascii' codec can't decode byte 0xc3 in position 5: ordinal not in range(128).  You passed in <django.utils.functional.__proxy__ object at 0xb581d98c> (<class 'django.utils.functional.__proxy__'>)
[...]

Unicode error hint

The string that could not be encoded/decoded was: Conte��do

Please, advise. --
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...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.

--
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...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.
 
 


--   Kind regards,    Roberto López López      System Developer  Parallab, Uni Computing  Høyteknologisenteret, Thormøhlensgate 55  N-5008 Bergen, Norway  Tel:        (+47) 555 84091

No comments:

Post a Comment