1
Vote

TAR writer cannot handle German characters

description

Hi Adam,

It seems the library does not use the ArchiveEncoding.Default encoding settings in case of TarWriter. Because of this if the file's name contains special charachters, it will be compressed with incorrect file name.

Could you update the TarHeader.cs class?
    private static void WriteStringBytes(string name, byte[] buffer, int offset, int length)
    {
        int i;

        for (i = 0; i < length - 1 && i < name.Length; ++i)
        {
            buffer[offset + i] = (byte)name[i];
        }

        for (; i < length; ++i)
        {
            buffer[offset + i] = 0;
        }
    }
Thanks,
Imre

file attachments

comments