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

qs.parse decoder option doesn't work on IOS web view environment #455

Open
logone72 opened this issue Nov 22, 2022 · 1 comment
Open

qs.parse decoder option doesn't work on IOS web view environment #455

logone72 opened this issue Nov 22, 2022 · 1 comment

Comments

@logone72
Copy link

logone72 commented Nov 22, 2022

My app is currently using web view with creating and parsing query string with qs.

qs.parse(location.search.replace('?', ''), { decoder: decodeURIComponent });

Like above, I'm passing decodeURIComponent as decoder for qs.parse()

The problem is, on IOS web view environment, it returns un-decoded string(the result of encodeURIComponent).

is there some underlying conditions on decoder option?

it works fine on pc browser, and android browser.

@ljharb
Copy link
Owner

ljharb commented Nov 22, 2022

decodeURIComponent is not a valid decoder function when used directly; you have to wrap it in a valid one.

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

No branches or pull requests

2 participants