Hi,

Le 22 août 2013 à 08:25, Radomir Wojcik <rado...@cldssinc.com> a écrit :

> Adding the unicode u to the 'string' as such u'string'  fixes the issue but 
> now I have to add this u to every string that will potentially have a 
> character with a french accent in it? How come MySQL didn't need this? There 
> must be a straight forward answer to this, something that will make Postgres 
> + django handle every string as unicode.

As a french user, I haven't faced encoding issues with Django and Postgres.
As Russell pointed out, you need to make sure your postgres database is utf8 
and the data you imported also were.
Your concerns shows that something's wrong with one of those two things - or 
maybe both.

By the way, if you're using python 2, you shouldn't be using 'string' notation 
for character strings and should be using the u'string' one.
'string' is a binary string while u'string' is a text string.
This is misleading with python 2 as there's implicit conversion between the two 
and utf8 will be used as the default charset which may lead to the kind of 
errors you've faced.

Mysql is more flexible about that but you may have missed that it has something 
like 4 different encoding configuration parameters and your client side 
configuration may have been utf8.
In this regard, postgresql might look too restrictive but it's safer and better.

Best regards,
Xavier.

-- 
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+unsubscr...@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.

Reply via email to