Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix multibyte unicode support #7

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

rungta
Copy link

@rungta rungta commented Oct 26, 2018

Enkoder does not currently support multibyte characters such as . For example, encoding don’t results in donâ��t.

This pull request adds full support for unicode characters (including Emoji 😀). It is based on CloudFlare’s solution and uses escape() to percentage encode the final reconstructed string's bytes, and then decodeURIComponent() to properly handle unicode characters.

rungta and others added 5 commits October 26, 2018 19:42
Use escape() to percentage encode the final reconstructed string to percentage encode the string's bytes, and then decodeURIComponent() to properly handle unicode characters (as explained in https://blog.jse.li/posts/cloudflare-scrape-shield/).
Fix `TypeError: Cannot read property 'parentNode' of null` bug
- No longer necessary in modern browsers
- Ensures the enkoder still works when used with scripts that compact source code and strip out comments
Remove comments before and after inserted JS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants