[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

[其他] Robocopy /UNILOG 参数生成的日志实质是GBK的编码?

本帖最后由 523066680 于 2014-12-14 13:52 编辑
  1. robocopy /L /MIR /copyall /TEE "%src%" "%dst%"  /XD %fold% /XF %file% ^
  2.          /UNILOG:"UniLog%dt:/=-%.txt" /X /FP /NS /NDL /NP
复制代码
其中 /UNILOG 参数的作用

     :: 以 UNICODE 方式将状态输出到日志文件(覆盖现有日志)。

实际执行后生成的文件,开头两个字节是UTF-16LE 的BOM \xFF\xFE
但是后面的内容全都是GBK编码的,Are you kidding me?
  1. ff fe
  2. 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d
  3. 20 20 20 52 4f 42 4f 43 4f 50 59 20 20 20 20 20 3a 3a 20 20 20 20 20 57 69 6e 64 6f 77 73 20 b5 c4 bf c9 bf bf ce c4 bc fe b8 b4 d6 c6 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
  4. 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d
复制代码
对应
  1. -------------------------------------------------------------------------------
  2.    ROBOCOPY     ::     Windows 的可靠文件复制                              
  3. -------------------------------------------------------------------------------
复制代码
WIN7 32位
1

评分人数

    • yu2n: 不明觉厉~ XD技术 + 1

这里有一个相同问题的帖子(可能要翻*访问):
http://answers.microsoft.com/en-us/windows/forum/windows_7-windows_programs/windows-7-robocopy-unilog-option-appears/83d01ade-7dc7-4094-9dd0-90369b4bbced

Question
Windows 7 robocopy /UNILOG option appears completely broken

I tried to use /UNILOG:logfile with robocopy and the output file is corrupt.

It has the UNICODE BOM (FFFE), but the characters that follow are ANSI, except for the line of text
following "Options :", which does consist of actual UNICODE characters.  However, immediately following
that, it reverts back to ANSI, and if any of the files/paths in the listing really had a wide character, it is
obliterated (appears as a single '?', so not even UTF-8).

I don't suppose there's any hope to see this fixed, since the story on Windows 8 robocopy is that it
has even more bugs?

TOP

返回列表