Javascript encodeURIComponent doesn't encode single quotes

后端 未结 6 1425
刺人心
刺人心 2021-02-01 03:39

Try it out:

encodeURIComponent(\"\'@#$%^&\");

If you try this out you will see all the special characters are encoded except for the single

6条回答
  •  一向
    一向 (楼主)
    2021-02-01 04:06

    You can use btoa() and atob(), this encodes and decodes the given string including single quote.

提交回复
热议问题