diff options
-rw-r--r-- | docs/settings.rst | 2 | ||||
-rw-r--r-- | wkhtmltopdf/utils.py | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/docs/settings.rst b/docs/settings.rst index 7b5116a..63b1116 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -21,7 +21,7 @@ this app will look for the binary using the default OS paths. WKHTMLTOPDF_CMD_OPTIONS ~~~~~~~~~~~~~~~~~~~~~~~ -Default: ``{'quiet': True}`` +Default: ``{'encoding': 'utf8', 'quiet': True}`` A dictionary of command-line arguments to pass to the ``wkhtmltopdf`` binary. diff --git a/wkhtmltopdf/utils.py b/wkhtmltopdf/utils.py index 99998a2..8e0caef 100644 --- a/wkhtmltopdf/utils.py +++ b/wkhtmltopdf/utils.py @@ -71,6 +71,9 @@ def wkhtmltopdf(pages, output=None, **kwargs): options = copy(options) options.update(kwargs) + # Force --encoding utf8 unless the user has explicitly overridden this. + options.setdefault('encoding', 'utf8') + env = getattr(settings, 'WKHTMLTOPDF_ENV', None) if env is not None: env = dict(os.environ, **env) |