javascript-obfuscator/javascript-obfuscator

Unicode gets unescaped

已關閉

#345 建立於 2018年10月25日

 (3 則留言) (2 個反應) (0 位負責人)TypeScript (1,413 個分叉)batch import
PR is welcomedbughelp wantedwontfix

倉庫指標

星標
 (12,059 顆星)
PR 合併指標
 (平均合併 10天 3小時) (30 天內合併 1 個 PR)

描述

The obfuscator seems to unescape escaped unicode in strings. For example, consider the following input javascript:

console.log("\ud83d\ude03");
console.log("😃");

Expected Behavior

I expect the unicode escape sequences to be preserved. Something like this is expected:

console['log']('\ud83d\ude03');console['log']('😃');

Current Behavior

Escaped characters are unescaped. For the code above, the default obfuscation options produce:

console['log']('😃');console['log']('😃');

Notice the smiley faces appear as unicode characters, that is, they are no longer escaped. Note that if the "Escape Unicode Sequence" option is enabled then that does not happen and instead we get:

console['\x6c\x6f\x67']('\ud83d\ude03');console['\x6c\x6f\x67']('\ud83d\ude03');

However, from my understanding and documentation, this option is not about unescaping unicode, it is about escaping unicode (or escaping everything in general).

Steps to Reproduce (for bugs)

Obfuscate the above code using default configuration on https://obfuscator.io/ .

Your Environment

Used https://obfuscator.io/ .

貢獻者指南