Let NULL input charset in image reading, that defaults to locale one.
This commit is contained in:
@ -1486,14 +1486,21 @@ int iso_image_filesystem_new(IsoDataSource *src, struct iso_read_opts *opts,
|
||||
data->mode = opts->mode & ~S_IFMT;
|
||||
data->messenger = messenger;
|
||||
|
||||
data->input_charset = strdup(opts->input_charset);
|
||||
|
||||
setlocale(LC_CTYPE, "");
|
||||
data->local_charset = strdup(nl_langinfo(CODESET));
|
||||
if (data->local_charset == NULL) {
|
||||
ret = ISO_MEM_ERROR;
|
||||
goto fs_cleanup;
|
||||
}
|
||||
if (opts->input_charset != NULL) {
|
||||
data->input_charset = strdup(opts->input_charset);
|
||||
} else {
|
||||
data->input_charset = strdup(data->local_charset);
|
||||
}
|
||||
if (data->input_charset == NULL) {
|
||||
ret = ISO_MEM_ERROR;
|
||||
goto fs_cleanup;
|
||||
}
|
||||
|
||||
ifs->open = ifs_fs_open;
|
||||
ifs->close = ifs_fs_close;
|
||||
|
@ -278,6 +278,9 @@ struct iso_read_opts
|
||||
//TODO differ file and dir mode
|
||||
//option to convert names to lower case?
|
||||
|
||||
/**
|
||||
* Input charset for RR file names. NULL to use default locale charset.
|
||||
*/
|
||||
char *input_charset;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user