def to_json(self, destination):
try:<EOL><INDENT>with open(destination, "<STR_LIT:w>") as file:<EOL><INDENT>dump(<EOL>self.main_dictionnary,<EOL>file,<EOL>ensure_ascii=False,<EOL>indent=<NUM_LIT:4>,<EOL>sort_keys=True,<EOL>)<EOL><DEDENT><DEDENT>except UnicodeEncodeError:  <EOL><INDENT>with open(destination, "<STR_LIT:w>", encoding="<STR_LIT:utf-8>") as file:<EOL><INDENT>dump(<EOL>self.main_dictionnary,<EOL>file,<EOL>ensure_ascii=False,<EOL>indent=<NUM_LIT:4>,<EOL>sort_keys=True,<EOL>)<EOL><DEDENT><DEDENT>
Save a dictionnary into a JSON file.

:param destination:
    A path to a file where we're going to
    write the converted dict into a JSON format.
:type destination: str