Equivalent JavaScript functions for Python’s urllib.parse.quote() and urllib.parse.unquote()

JavaScript               |  Python
----------------------------------- 
encodeURI(str)           |  urllib.parse.quote(str, safe="~@#$&()*!+=:;,?/\"');
-----------------------------------
encodeURIComponent(str)  |  urllib.parse.quote(str, safe="~()*!\"')

On Python 3.7+ you can remove ~ from safe=.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)