SpringBoot - Message.properties not displaying french special characters

Viewed 438

In springboot i have messages_fr.properties. I have a value that is publicités, images clés but it displays as publicit�s, images cl�s.

I have tried setting UTF-8, not working. Below is my code.

@Bean
    public MessageSource messageSource() {
        ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
        messageSource.setBasenames("classpath:messages");
        messageSource.setDefaultEncoding("UTF-8");
        return messageSource;
    }

This is how i fetch the key :-

messageSource.getMessage(myKey, null, Locale.French)

Please advise if i have to add anything.

0 Answers
Related