diff options
author | John Stebbins <[email protected]> | 2020-04-22 07:48:33 -0600 |
---|---|---|
committer | John Stebbins <[email protected]> | 2020-04-22 07:50:42 -0600 |
commit | cd252068e94ea1edff177e5abe93c38c5eb6a037 (patch) | |
tree | f2c384502867c0c88cdf6bc3c5637ed0d55878f2 /libhb/hb_dict.c | |
parent | 56f64e0f510e4df8e95167da31a0a3f55fe737cc (diff) |
hb_dict: fix loading preset files with unicode path
Thanks to Pierce Lopez for pointing out a solution
Fixes https://github.com/HandBrake/HandBrake/issues/2427
Diffstat (limited to 'libhb/hb_dict.c')
-rw-r--r-- | libhb/hb_dict.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/libhb/hb_dict.c b/libhb/hb_dict.c index 0dbd5c80b..439e74f59 100644 --- a/libhb/hb_dict.c +++ b/libhb/hb_dict.c @@ -92,8 +92,16 @@ hb_value_t * hb_value_json(const char *json) hb_value_t * hb_value_read_json(const char *path) { + FILE * fp; json_error_t error; - hb_value_t *val = json_load_file(path, 0, &error); + + fp = hb_fopen(path, "r"); + if (fp == NULL) + { + return NULL; + } + hb_value_t *val = json_loadf(fp, 0, &error); + fclose(fp); return val; } |