Skip to content

Commit

Permalink
fix(nahsra#456): fix default charset problem
Browse files Browse the repository at this point in the history
Signed-off-by: GodMeowIceSun <[email protected]>
  • Loading branch information
GodMeowIceSun committed May 31, 2024
1 parent 926f57e commit 28e4885
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
*/
package org.owasp.validator.html.util;

import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.text.MessageFormat;
import java.util.ResourceBundle;

Expand Down Expand Up @@ -87,6 +89,10 @@ public final class ErrorMessageUtil {
private ErrorMessageUtil() {}

public static String getMessage(ResourceBundle messages, String msgKey, Object[] arguments) {
return MessageFormat.format(messages.getString(msgKey), arguments);
return MessageFormat.format(
new String(
messages.getString(msgKey).getBytes(StandardCharsets.ISO_8859_1),
Charset.defaultCharset()),
arguments);
}
}

0 comments on commit 28e4885

Please sign in to comment.