I have a problem with my accented characters. Django admin saves my data without encoding to something like "á
"
Example: if im trying to use a word like "Canción", i would like it to save in this way: Canción
, and not Canción.
i have in my SETTING: DEFAULT_CHARSET = 'utf-8'
i have in my mysql database: utf8_general_ci
I'm using the Sociable app:
{% load sociable_tags %}
{% get_sociable Facebook TwitThis Google MySpace del.icio.us YahooBuzz Live as sociable_links with url=object.get_absolute_url title=object.titulo %}
{% for link in sociable_links %}
<a href="{{ link.link }}"><img alt="{{ link.site }}" title="{{ link.site }}" src="{{ link.image }}" /></a>
{% endfor %}
But I'm getting an error if my object.titulo (title of the article) has an accented word.
Traceback:
File "C:\wamp\bin\Python26\lib\site-packages\django\core\handlers\base.py" in get_response
100. response = callback(request, *callback_args, **callback_kwargs)
File "C:\wamp\bin\Python26\lib\site-packages\django\views\generic\date_based.py" in object_detail
366. response = HttpResponse(t.render(c), mimetype=mimetype)
File "C:\wamp\bin\Python26\lib\site-packages\django\template\__init__.py" in render
173. return self._render(context)
File "C:\wamp\bin\Python26\lib\site-packages\django\template\__init__.py" in _render
167. return self.nodelist.render(context)
File "C:\wamp\bin\Python26\lib\site-packages\django\template\__init__.py" in render
796. bits.append(self.render_node(node, context))
File "C:\wamp\bin\Python26\lib\site-packages\django\template\debug.py" in render_node
72. result = node.render(context)
File "C:\wamp\bin\Python26\lib\site-packages\django\template\loader_tags.py" in render
125. return compiled_parent._render(context)
File "C:\wamp\bin\Python26\lib\site-packages\django\template\__init__.py" in _render
167. return self.nodelist.render(context)
File "C:\wamp\bin\Python26\lib\site-packages\django\template\__init__.py" in render
796. bits.append(self.render_node(node, context))
File "C:\wamp\bin\Python26\lib\site-packages\django\template\debug.py" in render_node
72. result = node.render(context)
File "C:\wamp\bin\Python26\lib\site-packages\django\template\loader_tags.py" in render
62. result = block.nodelist.render(context)
File "C:\wamp\bin\Python26\lib\site-packages\django\template\__init__.py" in render
796. bits.append(self.render_node(node, context))
File "C:\wamp\bin\Python26\lib\site-packages\django\template\debug.py" in render_node
72. result = node.render(context)
File "C:\wamp\bin\Python26\lib\site-packages\sociable\templatetags\sociable_tags.py" in render
37. 'link': sociable.genlink(site, **self.values),
File "C:\wamp\bin\Python26\lib\site-packages\sociable\sociable.py" in genlink
20. values['title'] = quote_plus(kwargs['title'])
File "C:\wamp\bin\Python26\lib\urllib.py" in quote_plus
1228. s = quote(s, safe + ' ')
File "C:\wamp\bin\Python26\lib\urllib.py" in quote
1222. res = map(safe_map.__getitem__, s)
Exception Type: TemplateSyntaxError at /noticia/2010/jun/10/matan-domingo-paquete-en-la-avenida-san-vicente-de-paul/
Exception Value: Caught KeyError while rendering: u'\xfa'
Thanks!