diff --git a/src/main/java/org/owasp/validator/html/util/ErrorMessageUtil.java b/src/main/java/org/owasp/validator/html/util/ErrorMessageUtil.java index baf4ebef..41127b18 100644 --- a/src/main/java/org/owasp/validator/html/util/ErrorMessageUtil.java +++ b/src/main/java/org/owasp/validator/html/util/ErrorMessageUtil.java @@ -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; @@ -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); } }