django-cities-light icon indicating copy to clipboard operation
django-cities-light copied to clipboard

Warning: Incorrect string value: '\xCA\xBCs al...' for column 'name' at row 1

Open jaiswalankit opened this issue 11 years ago • 9 comments

This is the complete stack trace of the issue, generating while running "python manage.py cities_light" command:

/usr/local/lib/python2.7/dist-packages/autoslug/utils.py:30: RuntimeWarning: Argument <type 'str'> is not an unicode object. Passing an encoded string will likely have unexpected results. return django_slugify(unidecode(value))

RAM used: 31420 kB Time: 0:00:00 Done: 100%|###################################| Warning: Incorrect string value: '\xCA\xBCs al...' for column 'name' at row 1

jaiswalankit avatar Aug 13 '14 08:08 jaiswalankit

What OS ?

Is there any way I can reproduce this ?

Could you reproduce it in a virtualenv ? I see that you probably ran sudo pip install which is not a good idea because it would install packages globally and potentially mess with python dependencies for system-installed tools.

jpic avatar Aug 18 '14 08:08 jpic

It's Ubuntu 12.04. You can reproduce is by importing the data into the tables. I can see some characters in the name field of City API which might be causing the char set issue.

ankitjaiswal07 avatar Aug 18 '14 13:08 ankitjaiswal07

Which database are you using? I suspect it is a problem related to encoding using MySQL.

mauricioabreu avatar Dec 29 '14 02:12 mauricioabreu

Did you try with python 3 ?

jpic avatar Dec 29 '14 10:12 jpic

No, it was python 2.7.5 and yes, I was using MYSQL database.

On Mon, Dec 29, 2014 at 3:41 PM, James Pic [email protected] wrote:

Did you try with python 3 ?

— Reply to this email directly or view it on GitHub https://github.com/yourlabs/django-cities-light/issues/62#issuecomment-68245548 .

jaiswalankit avatar Jan 04 '15 16:01 jaiswalankit

Might be fixed by #77

jpic avatar Jan 28 '15 17:01 jpic

Which CHARACTER SET and COLLATE is your mysql database?

lluiscanals avatar Apr 25 '15 18:04 lluiscanals

change your database and its tables to support ut8, it will fix the issue.

kodeine avatar Aug 19 '16 05:08 kodeine

change your database and its tables to support ut8, it will fix the issue.

YES, 4 example:

CREATE DATABASE weblate CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

Garfius avatar Feb 14 '20 12:02 Garfius