Use Charset instead of String for Mustache template encoding by ddongjunn · Pull Request #48347 · spring-projects/spring-boot
The MustacheResourceTemplateLoader previously defined the template encoding as a String, defaulting to "UTF-8". This change replaces the field with a Charset and initializes it with StandardCharsets.UTF_8. Using Charset improves type safety and aligns with modern Spring Boot standards, while avoiding implicit charset lookup issues. Signed-off-by: djlee <ddongjunn@gmail.com>
Add setCharset(Charset) overload to MustacheResourceTemplateLoader while keeping setCharset(String) for backward compatibility. The String-based method is deprecated in favor of the Charset variant. Also deprecate MustacheProperties.getCharsetName() as it's primarily used with the deprecated setCharset(String) method. This change maintains backward compatibility while providing a more type-safe API that aligns with modern Java standards. See spring-projectsgh-48347 Signed-off-by: djlee <ddongjunn@gmail.com>
snicoll pushed a commit to snicoll/spring-boot that referenced this pull request
Dec 1, 2025The MustacheResourceTemplateLoader previously defined the template encoding as a String, defaulting to "UTF-8". This change replaces the field with a Charset and initializes it with StandardCharsets.UTF_8. Using Charset improves type safety and aligns with modern Spring Boot standards, while avoiding implicit charset lookup issues. See spring-projectsgh-48347 Signed-off-by: djlee <ddongjunn@gmail.com>
snicoll pushed a commit that referenced this pull request
Dec 19, 2025The MustacheResourceTemplateLoader previously defined the template encoding as a String, defaulting to "UTF-8". This change replaces the field with a Charset and initializes it with StandardCharsets.UTF_8. Using Charset improves type safety and aligns with modern Spring Boot standards, while avoiding implicit charset lookup issues. See gh-48347 Signed-off-by: djlee <ddongjunn@gmail.com>
snicoll added a commit that referenced this pull request
Dec 19, 2025This replaces the use of charset name for our Mustache support. See gh-48347
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters