diff options
| author | Roy Marples <roy@marples.name> | 2017-03-09 00:18:10 +0000 |
|---|---|---|
| committer | Lukas Fleischer <lfleischer@lfos.de> | 2017-08-10 15:15:55 +0200 |
| commit | 67e2b69ec96a117b98c9028013ce0258574efe80 (patch) | |
| tree | b15b6f1753bdd3b941ace3ce4cd1e0cf81885807 /filter.c | |
| parent | ui-atom: properly escape delimiter in page link (diff) | |
| download | cgit-67e2b69ec96a117b98c9028013ce0258574efe80.tar.gz cgit-67e2b69ec96a117b98c9028013ce0258574efe80.tar.bz2 cgit-67e2b69ec96a117b98c9028013ce0258574efe80.zip | |
filter: set environment variable PYTHONIOENCODING to utf-8
This allows different versions of Python to be used rather than
forcing version specific encoding in each script.
Signed-off-by: Roy Marples <roy@marples.name>
Signed-off-by: John Keeping <john@keeping.me.uk>
Diffstat (limited to '')
| -rw-r--r-- | filter.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -55,6 +55,8 @@ static int open_exec_filter(struct cgit_filter *base, va_list ap) close(filter->pipe_fh[1]); chk_non_negative(dup2(filter->pipe_fh[0], STDIN_FILENO), "Unable to use pipe as STDIN"); + /* Always input/output utf-8 for a Python filter. */ + setenv("PYTHONIOENCODING", "utf-8", 1); execvp(filter->cmd, filter->argv); die_errno("Unable to exec subprocess %s", filter->cmd); } |