8000 dtar: set the locale for character handling by thiell · Pull Request #643 · hpc/mpifileutils · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

dtar: set the locale for character handling #643

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

thiell
Copy link
@thiell thiell commented May 14, 2025

This ensures that UTF-8 file names are handled correctly by libarchive.

Without setlocale():

$ touch foo/bår
$ dtar -c --preserve-owner --preserve-times --preserve-perms --bufsize 16MB --chunksize 64MB -f /tmp/testenc3.tar foo
[2025-05-13T17:59:24] Walking /abc/foo
[2025-05-13T17:59:26] Walked 2 items in 2.015 secs (0.993 items/sec) ...
[2025-05-13T17:59:26] Walked 2 items in 2.015 seconds (0.993 items/sec)
[2025-05-13T17:59:26] Writing archive to /tmp/testenc3.tar
[2025-05-13T17:59:26] Items: 2
[2025-05-13T17:59:26]   Directories: 1
[2025-05-13T17:59:26]   Files: 1
[2025-05-13T17:59:26]   Links: 0
[2025-05-13T17:59:26] Data: 0.000 B (0.000 B per file)
[2025-05-13T17:59:26] Sorted 2 items in 0.015 seconds (137.712 items/sec)
[2025-05-13T17:59:26] [0] [mpifileutils-v0.12/mpifileutils/src/common/mfu_flist_archive.c:345] ERROR: archive_write_header(): Can't translate pathname 'foo/bår' to UTF-8
[2025-05-13T17:59:26] Truncating archive
[2025-05-13T17:59:26] Gathering index
[2025-05-13T17:59:26] Writing index as last entry in /tmp/testenc3.tar
[2025-05-13T17:59:26] Writing entry headers
[2025-05-13T17:59:26] [0] [mpifileutils-v0.12/mpifileutils/src/common/mfu_flist_archive.c:345] ERROR: archive_write_header(): Can't translate pathname 'foo/bår' to UTF-8
[2025-05-13T17:59:26] [0] [mpifileutils-v0.12/mpifileutils/src/common/mfu_flist_archive.c:527] ERROR: Failed to encode header for `/abc/foo/bår'
[2025-05-13T17:59:26] Copying file data
[2025-05-13T17:59:26] Started:   May-13-2025, 17:59:26
[2025-05-13T17:59:26] Completed: May-13-2025, 17:59:26
[2025-05-13T17:59:26] Seconds: 0.022
[2025-05-13T17:59:26] Archive size: 6.500 KiB
[2025-05-13T17:59:26] Rate: 300.788 KiB/s (6656 bytes in 0.022 seconds)

With setlocale():

$ touch foo/bår
$ dtar -c --preserve-owner --preserve-times --preserve-perms --bufsize 16MB --chunksize 64MB -f /tmp/testenc4.tar foo
[2025-05-13T17:59:42] Walking /abc/foo
[2025-05-13T17:59:42] Walked 2 items in 0.266 secs (7.515 items/sec) ...
[2025-05-13T17:59:42] Walked 2 items in 0.266 seconds (7.511 items/sec)
[2025-05-13T17:59:42] Writing archive to /tmp/testenc4.tar
[2025-05-13T17:59:42] Items: 2
[2025-05-13T17:59:42]   Directories: 1
[2025-05-13T17:59:42]   Files: 1
[2025-05-13T17:59:42]   Links: 0
[2025-05-13T17:59:42] Data: 0.000 B (0.000 B per file)
[2025-05-13T17:59:42] Sorted 2 items in 0.007 seconds (286.076 items/sec)
[2025-05-13T17:59:42] Truncating archive
[2025-05-13T17:59:42] Gathering index
[2025-05-13T17:59:42] Writing index as last entry in /tmp/testenc4.tar
[2025-05-13T17:59:42] Writing entry headers
[2025-05-13T17:59:42] Copying file data
[2025-05-13T17:59:42] Started:   May-13-2025, 17:59:42
[2025-05-13T17:59:42] Completed: May-13-2025, 17:59:42
[2025-05-13T17:59:42] Seconds: 0.012
[2025-05-13T17:59:42] Archive size: 6.500 KiB
[2025-05-13T17:59:42] Rate: 563.669 KiB/s (6656 bytes in 0.012 seconds)

This ensures that UTF-8 file names are handled correctly by libarchive.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
41D3 Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0