diff options
| author | Werner Koch <[email protected]> | 2020-08-21 19:28:28 +0000 |
|---|---|---|
| committer | Werner Koch <[email protected]> | 2020-08-21 19:28:28 +0000 |
| commit | 34e7703a962809921e83770f20f3eb66599265d1 (patch) | |
| tree | 2d5f0418759d91c779add74bd2e865c8bef518dc /tools/gpgtar.c | |
| parent | common: Use gpgrt functions for mkdir and chdir. (diff) | |
| download | gnupg-34e7703a962809921e83770f20f3eb66599265d1.tar.gz gnupg-34e7703a962809921e83770f20f3eb66599265d1.zip | |
gpgtar,w32: Handle Unicode file names.
* tools/gpgtar.c (oUtf8Strings): New.
(opts): Add option --utf8-strings.
(parse_arguments): Set option.
* tools/gpgtar.h (opt): Add field utf8strings.
* tools/gpgtar-create.c (name_to_utf8): New.
(fillup_entry_w32): Use that.
(scan_directory): Ditto.
(scan_directory) [W32]: Convert file name to utf8.
(gpgtar_create): Convert pattern.
--
Note that this works only with file names read from a file or if the
specified files on the command line are plain ascii. When recursing
into a directory Unicode file names work again. This limitation is
due to main(int, char**) which can't get the wchar version. We could
fix that but is needs a bit more work in our init code.
GnuPG-bug-id: 4083
Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'tools/gpgtar.c')
| -rw-r--r-- | tools/gpgtar.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/gpgtar.c b/tools/gpgtar.c index 4a5a00a1f..a06e870ad 100644 --- a/tools/gpgtar.c +++ b/tools/gpgtar.c @@ -75,6 +75,7 @@ enum cmd_and_opt_values oCMS, oSetFilename, oNull, + oUtf8Strings, /* Compatibility with gpg-zip. */ oGpgArgs, @@ -120,6 +121,12 @@ static gpgrt_opt_t opts[] = { ARGPARSE_s_s (oFilesFrom, "files-from", N_("|FILE|get names to create from FILE")), ARGPARSE_s_n (oNull, "null", N_("-T reads null-terminated names")), +#ifdef HAVE_W32_SYSTEM + ARGPARSE_s_n (oUtf8Strings, "utf8-strings", + N_("-T reads UTF-8 encoded names")), +#else + ARGPARSE_s_n (oUtf8Strings, "utf8-strings", "@"), +#endif ARGPARSE_s_s (oGpgArgs, "gpg-args", "@"), ARGPARSE_s_s (oTarArgs, "tar-args", "@"), @@ -325,6 +332,7 @@ parse_arguments (gpgrt_argparse_t *pargs, gpgrt_opt_t *popts) case oNoVerbose: opt.verbose = 0; break; case oFilesFrom: files_from = pargs->r.ret_str; break; case oNull: null_names = 1; break; + case oUtf8Strings: opt.utf8strings = 1; break; case aList: case aDecrypt: |
