From 175dc75fc428930034a6c93fb52f830d955d8e64 Mon Sep 17 00:00:00 2001
From: Mark Thomas <markt@apache.org>
Date: Mon, 31 Mar 2025 17:34:05 +0100
Subject: [PATCH] Fix back-port

Origin: https://github.com/apache/tomcat/commit/175dc75fc428930034a6c93fb52f830d955d8e64

---
 java/org/apache/catalina/valves/rewrite/RewriteValve.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/valves/rewrite/RewriteValve.java b/java/org/apache/catalina/valves/rewrite/RewriteValve.java
index f049e5eb7e40..b4e73f6845b4 100644
--- a/java/org/apache/catalina/valves/rewrite/RewriteValve.java
+++ b/java/org/apache/catalina/valves/rewrite/RewriteValve.java
@@ -552,7 +552,7 @@ public void invoke(Request request, Response response) throws IOException, Servl
                         // This is decoded and normalized
                         chunk.append(request.getServletContext().getContextPath());
                     }
-                    chunk.append(URLDecoder.decode(urlStringRewriteEncoded, uriCharset));
+                    chunk.append(URLDecoder.decode(urlStringRewriteEncoded, uriCharset.name()));
                     // Set the new Query if there is one
                     if (queryStringRewriteEncoded != null) {
                         request.getCoyoteRequest().queryString().setChars(MessageBytes.EMPTY_CHAR_ARRAY, 0, 0);
