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

Simple form submit with equally named input text fields are not UTF-8 encrypted #93

Open
baszero opened this issue Dec 20, 2021 · 0 comments

Comments

@baszero
Copy link
Contributor

baszero commented Dec 20, 2021

I observe the following:
When I use a form to submit simple text input fields which all have different names, the values are correctly retrieved as UTF-8 via the request object.

Form:

<form name="my" method="post">
  <input type="text" name="test-1" value="value1-äöü"/>
  <input type="text" name="test-2" value="value2-äöü"/>
</form>

In Java you use the following method to get the value: getEnvironment().getRequest().getParameter("test-1")

This works fine.

However if you decide to submit the input fields with all the same name (which is valid HTML), it does not work anymore:

<form name="my" method="post">
  <input type="text" name="test" value="value1-äöü"/>
  <input type="text" name="test" value="value2-äöü"/>
</form>

In Java you use the following method to get the value: getEnvironment().getRequest().getParameters("test")

The characters äöü are encoded and do not show up correctly anymore.

I suspect that Yanel does some sort of character translation or something like that.

Any guess?

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

1 participant