0

Legacy web apps still use Shift_JIS as the page character code.

In this application, if you set a specific multi-byte character to a GET Parameter with JavaScript, some characters will not be converted.

[Page character code: Shft_JIS]

<!doctype html>
<html>
<head>
    <title>Shift_JIS_AutoUrlEncode_Bug?</title>
    <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
    <script type="text/javascript">
    <!--
    function exec() {
        var url = location.href.split('?')[0];
        
        location.href = url + '?value=フー'
    }
    -->
    </script>
</head>
<body>
    <input type="button" value="Go Get Paramater Auto Encode!" onclick="exec();">
</body>
</html>

enter image description here

The character in question is "ー".

The automatic encoding by the browser results in "%81[".

I think it should be "%81%5B" correctly.

The previous web container (tomcat) allowed this request, but the latest version of the web container (tomcat) causes an error with "RFC 7230 and RFC 3986 violation".

If anything, it seems to be a bug in Chrome and Edge, but what do you think?

thanks.

powtok
  • 11
  • 1
  • 7

1 Answers1

0

I can reproduce this wrongly converted URL on Edge, Chrome and Firefox, which means it is not an issue specific to Edge or Chrome. I think you can workaround it on the tomcat side. You can refer to this thread.

Kendrick Li
  • 1,355
  • 1
  • 2
  • 10
  • It's not a problem specific to Edge or Chrome understood. I was able to deal with it with the linked relaxedQueryChars. However, I have a question about the characters specified in the linked relaxedQueryChars. It seems better to specify the [obsolete RFC 2396](https://tex2e.github.io/rfc-translater/html/rfc2396.html) delims/unwise character, so I'll use that. **relaxedQueryChars="[]|{}^\\`"** thanks. – powtok Mar 22 '23 at 03:50