I can't help shed much light on the problem, but it's worth saying
that 0xefbfbd is the sequence for the UTF-8 BOM (Byte Order Mark), see
http://en.wikipedia.org/wiki/Byte_order_mark#UTF-8 and is shown as a
zero-width invisible character.

It could be that however you're getting the "ó" onto the URL when you
type it directly is somehow dragging the invisible character along
with it.

I notice you're using utf-8 as the character set for your pages - I
think you're asking for trouble doing this since the utf-8 character
set allows for more characters than latin1 supports so it's possible
for your users to enter characters into the search form which won't
map into latin1 (this may not be a risk with your user base, granted)
- if you can't change the database character set I think you'd be
safer using latin1 for what you send and receive to the browser via
setting DEFAULT_CHARSET and the content-type header, although django
will still continue to use unicode/utf-8 internally. See
http://docs.djangoproject.com/en/dev/ref/unicode/ ... basically it's a
pain if you don't just stick with utf-8 :).

On Jun 9, 11:15 pm, refreegrata <refreegr...@yahoo.com> wrote:
> Hello list. I'm a newbie with django and have a problem with the
> encoding. I use postgreSQL 8.3 with psycopg2. My database is in latin1
> and i can't change this to utf-8(i don't have the permission), however
> the database have a client-encoding in utf-8. I think this solves the
> problem.
>
>
> When i type "ó" in the input box all works fine, and returns all
> coincidences and the url says "http://localhost/prueba_1/search/?q=ó";
> However when i type directly in the url "http://localhost/prueba_1/
> search/?q=ó" and press enter Django throw an error
> "Caught DatabaseError while rendering: carácter 0xefbfbd de
> codificación «UTF8» no tiene equivalente en «LATIN1»"
> and the url in the browser change to "http://localhost/prueba_1/
> search/?q=%F3". Why happens that?, I'm really confused with the themes
> about the encoding.
>
> That's is my question, thanks for read, and sorry for my poor english

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

Reply via email to