Skip to content

Update json.dumps arg in XLSXListField for Unicode characters#64

Merged
FlipperPA merged 1 commit intodjango-commons:mainfrom
suhanoves:patch-1
Sep 30, 2022
Merged

Update json.dumps arg in XLSXListField for Unicode characters#64
FlipperPA merged 1 commit intodjango-commons:mainfrom
suhanoves:patch-1

Conversation

@suhanoves
Copy link
Copy Markdown
Contributor

For languages with Unicode characters, ignoring ensure_ascii results in the Excel output of rows like

{
  "Заголовок": "пример",
}

in the wrong format:

{
  "\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a": "\u043f\u0440\u0438\u043c\u0435\u0440",
}

From documentation:

If ensure_ascii is true (the default), the output is guaranteed to have all incoming non-ASCII characters escaped. If ensure_ascii is false, these characters will be output as-is.

For languages with Unicode characters, ignoring `ensure_ascii` results in the Excel output of rows like
```
{
  "Заголовок": "пример",
}
```
in the wrong format:
```
{
  "\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a": "\u043f\u0440\u0438\u043c\u0435\u0440",
}
```

From documentation:
>> If ensure_ascii is true (the default), the output is guaranteed to have all incoming non-ASCII characters escaped. If ensure_ascii is false, these characters will be output as-is.
@suhanoves suhanoves changed the title Update XLSXListField Update json.dumps arg in XLSXListField for Unicode characters Sep 13, 2022
@FlipperPA FlipperPA merged commit dabe9b0 into django-commons:main Sep 30, 2022
@FlipperPA
Copy link
Copy Markdown
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants