@PropertySource and UTF-8 properties file

前端 未结 6 637
广开言路
广开言路 2020-12-20 23:11

Is it possible, using @PropertySource annotation, to configure the encoding that has to be used to load the property file?

An example to clarify my prob

6条回答
  •  长情又很酷
    2020-12-20 23:41

    my solution:

    new MyBean(new String(env.getProperty("application.name").getBytes("ISO-8859-1"), "UTF-8"));

提交回复
热议问题