- I have a page in non UTF-8 encoding.
- There is a form with
method="get"
. If I submit these non UTF-8 characters, they get to the URI. - When I try to run
decodeURIComponent()
on the URI, I get the infamous error:URIError: malformed URI sequence
.
Please follow the testcase.
Questions:
In which of the above steps (1, 2, 3) is the problem? 1 should be OK. 2 is the standard way to submit
<form>
. And 3 is the standard function. All these things are standard! Yet there must be an error somewhere.Are characters of encodings other than UTF-8 allowed in URIs? (If not, the problem apparently is in step 2).
After the problem is correctly diagnosed, the question is - what would be a clean solution to it? The page must stay in the non UTF-8 encoding.