如何在RAR文件中编码非ASCII文件名?

时间:2012-06-14 13:49:10

标签: delphi character-encoding file-format rar

我有一个文件名中包含非ASCII字母的RAR文件。我尝试用Delphi解码它。我的代码适用于ASCII文件名但在这些上失败了。它不是WideChar,也不是UTF8。我在这里找到了RAR规格: http://ams.cern.ch/AMS/amsexch/arch/rar/technote.txt 但它没有说明字符编码。 我尝试了WOTSIT.org但是所有RAR链接都已经死了(几乎每个链接都死了;我甚至联系了管理员,但他没有回复,也没有修复链接)。 它似乎不是8位编码,但不知道它是什么。

1 个答案:

答案 0 :(得分:5)

这是唯一一个关于名称的段落:

0x200 - FILE_NAME contains both usual and encoded
        Unicode name separated by zero. In this case
        NAME_SIZE field is equal to the length
        of usual name plus encoded Unicode name plus 1.

        If this flag is present, but FILE_NAME does not
        contain zero bytes, it means that file name
        is encoded using UTF-8.

似乎它是UTF-8,但你说它不是。你能再试一次吗?

相关问题