2

I have the following fixture:

- model: backoffice.Language
  pk: 1
  fields:
    name: Français
    code: fr

- model: backoffice.Language
  pk: 2
  fields:
    name: English
    code: en

- model: backoffice.Language
  pk: 3
  fields:
    name: ру́сский
    code: ru

I created the database using:

CREATE DATABASE xxx_db WITH ENCODING 'UTF8';

And yet I get:

django.core.serializers.base.DeserializationError: Problem installing fixture 'xxx/project_root\backoffice\fixtures\initial_data.yaml': 'charmap' codec can't decode byte 0x81 in position 321: character maps to <undefined>

If I remove the:

name: ру́сский

and replace it with a

name: russian

Fixture loads but in daytabase the 'ç' is incorrect:

Français

yaml is supposed to default to utf8. Is there anything to do with unicode() or overloading some funciton ?

** EDIT **

it does not come from postgresql because:

update backoffice_language set name = 'ру́сский' where id = 3;
update backoffice_language set name = 'Français' where id = 1;
select * from backoffice_language;

will display correct utf8 encoded data. I'm using django 1.6

Cœur
  • 37,241
  • 25
  • 195
  • 267
user2346536
  • 1,464
  • 2
  • 21
  • 43

0 Answers0