[fpc-pascal] TZipper and special file names like "atenção.txt" (#26213)

Reinier Olislagers reinierolislagers at gmail.com
Fri May 23 17:38:00 CEST 2014


On 23/05/2014 17:30, Michael Van Canneyt wrote:
> On Fri, 23 May 2014, silvioprog wrote:
>> I've tried to compress a small file with TZipper class, but, even it
>> compressing correcly, internaly, the file name is wrong. After
>> compressed, the original "atenção.txt" file was renamed to "atenþÒo.txt".
>>
>> I opened an issue here:
>>
>> http://bugs.freepascal.org/view.php?id=26213
>>
>> I have a program that makes daily backups, and just discovered this
>> problem when I noticed that it did not compressing files with names
>> with special characters.
> 
> This is not fixable. The zip standard has no rules for encoding filenames.
> Whatever bytes you put in is what comes out.
> You are entirely responsible for handling the encoding.

Not quite, according to the spec http://www.pkware.com/documents/casestudies
Appendix D language encoding/APPNOTE.TXT, D.2 supports UTF8.
See also D.5
and an alternative approach D.6/D.7 (which allows for more backward
compatibility)




More information about the fpc-pascal mailing list