Support for setting an output charset for RR NM entries.

It will default to input charset (i.e. the locale charset for now). 
Names will be stored internally in that locale charset. Note that input 
charset musn't be changed by user. Instead, we can provide an input 
charset property to IsoFilesystem implementations.
This commit is contained in:
Vreixo Formoso
2007-12-28 00:20:02 +01:00
parent 6c7c54af93
commit 9a90afcf69
9 changed files with 94 additions and 30 deletions

View File

@ -755,7 +755,22 @@ int ecma119_image_new(IsoImage *src, Ecma119WriteOpts *opts,
/* default to locale charset */
setlocale(LC_CTYPE, "");
target->input_charset = strdup(nl_langinfo(CODESET));
target->output_charset = strdup(target->input_charset); //TODO
if (target->input_charset == NULL) {
iso_image_unref(src);
free(target);
return ISO_MEM_ERROR;
}
if (opts->output_charset != NULL) {
target->output_charset = strdup(opts->output_charset);
} else {
target->output_charset = strdup(target->input_charset);
}
if (target->output_charset == NULL) {
iso_image_unref(src);
free(target);
return ISO_MEM_ERROR;
}
/*
* 2. Based on those options, create needed writers: iso, joliet...