Skip to content

Commit 8aae9d7

Browse files
author
Med Kamal
committed
adding utf8 encoding to documents data
1 parent 1c42790 commit 8aae9d7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ravendb/http/request_executor.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,8 @@ def __create_request(self, node: ServerNode, command: RavenCommand) -> Optional[
907907
request = command.create_request(node)
908908
# todo: optimize that if - look for the way to make less ifs each time
909909
if request.data and not isinstance(request.data, str) and not inspect.isgenerator(request.data):
910-
request.data = json.dumps(request.data, default=self.conventions.json_default_method)
910+
# Making sur that all documents are utf-8 decoded, avoiding any bizzar caracters in the database documents
911+
request.data = json.dumps(request.data, default=self.conventions.json_default_method, ensure_ascii=False).encode("utf-8")
911912

912913
# todo: 1117 - 1133
913914
return request or None

0 commit comments

Comments
 (0)