Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Sep 30, 2022

Conversation

suhanoves
Copy link
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 wharton:main Sep 30, 2022
@FlipperPA
Copy link
Member

Thank you! This has been published to PyPI at 2.2.0:

https://github.com/wharton/drf-excel/releases/tag/2.2.0

https://pypi.org/project/drf-excel/2.2.0/

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.

None yet

2 participants