On Thursday 28 December 2006 11:18, dutche wrote:
I don't know why, but when I write or take from the Database a word
with some kind of accent, Django shows a "?" instead. Why?? I've
changed the language in settings.py and even the TimeZone. If I escape
the chars with something like "á" it works, so isn't a problem
with my browser, right?

Well, your browser may not be detecting the "character encoding" correctly. If your data comes from a database that has it stored as "ISO-8859-1" and the browser thinks it's UTF-8, generally you get a mess. Equally important is the character encoding that your editor uses when it saves files like templates.

Your best bet is to standarize on one character encoding. Using UTF-8 for everything is probably the most future-proof.

Does anybody knows what can be it?? I've made a simple test to see what

the template returns, and it returns the "string" below:
>>> t = Template("My special letters are : áéíóú")
>>> c = Context({})
>>> t.render(c)

'My special letters are : \xe1\xe9\xed\xf3\xfa'

>>> print t.render(c)

My special letters are : áéíóú



If you do something on the commandline, you also have to check what encoding is being used by your terminal to display the characters back to you.

Any idea?

It is a mess, and has been for a while. It will go away when everybody agrees to use the same encoding. I fear, it will be with us for a long time :-/.

Thanks


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to