Thursday, August 22, 2013

Re: Can't decode french characters after switching to PostgrSQL from MySQL


On Thu, Aug 22, 2013 at 2:06 PM, Radomir Wojcik <radomir@cldssinc.com> wrote:
Its not a problem with the conversion process.

Well, with all due respect -- yes, it is. Allow me to assure you that PostgreSQL handles UTF-8 and unicode just fine. If you're getting errors, it's either a problem with your original source of data, or in your conversion process getting the data into Django. This means the data you're putting in either isn't unicode to start with, or isn't being imported in a format that is being identified as unicode, and is being double converted.
 
I re-created the schema using django syncdb and then I went table by table putting the data back in using csv files I exported from MySQL. I took the long way to get this all in and PostgreSQL had no problems taking my csv data as input.  Any advice on how to get PostgreSQL running properly as MySQL did would be appreciated. It must be able to handle french accents which are not ascii.

So lets get this straight -- you're exporting from MySQL -- a database with (ahem) esoteric encoding behavior for UTF data -- into CSV -- a data format with no concept of character encoding -- and then you're importing into PostgreSQL. I almost don't have enough fingers to count the places where you could be introducing encoding problems. 

As for how to get PostgreSQL running properly? Make sure that you've created your database cluster with UTF-8. That's it. 

If you're having problems loading and retrieving UTF-8 data, it's because your original data source isn't encoded as UTF-8, or you're loading it in a way that is double encoding. However, since you haven't provided any details or samples, it's impossible to say what you're doing wrong.

Yours,
Russ Magee %-)

--
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.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate