我有一个 RAR 文件,文件名中包含非 ASCII 字母。我尝试在 Delphi 中解码它。我的代码对于 ASCII 文件名工作正常,但对于这些文件名却失败了。它不是 WideChar,也不是 UTF8。我在这里找到了 RAR 规范: http://ams.cern.ch/AMS/amsexch/arch/rar/technote.txt 但它没有提到字符编码。 我尝试了 WOTSIT.org,但所有 RAR 链接都已失效(几乎每个链接都已失效;我什至联系了管理员,但他没有回复也没有修复链接)。 似乎不是 8 位编码,但不知道它可能是什么。
最佳答案
这是唯一提及该名称的段落:
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,但你说不是。你能再试一次吗?
关于delphi - RAR 文件中的非 ASCII 文件名是如何编码的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11034550/