wyona / yanel

http://www.yanel.org
Apache License 2.0
10 stars 5 forks source link

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

Open baszero opened 2 years ago

baszero commented 2 years ago

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?