8000 Unicode gets unescaped · Issue #345 · javascript-obfuscator/javascript-obfuscator · GitHub
[go: up one dir, main page]

Skip to content
Unicode gets unescaped #345
Open
Open
@piotrm0

Description

@piotrm0

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/ .

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0