Skip to content

Commit 28e4885

Browse files
committed
fix(nahsra#456): fix default charset problem
Signed-off-by: GodMeowIceSun <[email protected]>
1 parent 926f57e commit 28e4885

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/main/java/org/owasp/validator/html/util/ErrorMessageUtil.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
*/
2424
package org.owasp.validator.html.util;
2525

26+
import java.nio.charset.Charset;
27+
import java.nio.charset.StandardCharsets;
2628
import java.text.MessageFormat;
2729
import java.util.ResourceBundle;
2830

@@ -87,6 +89,10 @@ public final class ErrorMessageUtil {
8789
private ErrorMessageUtil() {}
8890

8991
public static String getMessage(ResourceBundle messages, String msgKey, Object[] arguments) {
90-
return MessageFormat.format(messages.getString(msgKey), arguments);
92+
return MessageFormat.format(
93+
new String(
94+
messages.getString(msgKey).getBytes(StandardCharsets.ISO_8859_1),
95+
Charset.defaultCharset()),
96+
arguments);
9197
}
9298
}

0 commit comments

Comments
 (0)