properties to solve the Chinese garbled

Reads the properties file, solve the Chinese garbled
        ConfigurableEnvironment environment = context.getEnvironment();
            String env=environment.getActiveProfiles()[0];
            Properties   pro = new Properties();
            Map<String, String> mpro = new HashMap<String, String>();
            String proName ="/application-"+env+".properties";
            InputStreamReader isr=null;
            isr=new InputStreamReader( this.getClass().getResourceAsStream(proName),"UTF-8");
            pro.load(isr);
            Iterator<String> it=pro.stringPropertyNames().iterator();
            shopAppTabs= pro.getProperty("lanhu.appTab.shopAppTab");

Use apollo read, the current adding type @EnableApolloConfig, reads the corresponding namespace

 Config config = ConfigService.getConfig("RD.int-spring-qpl-shop");
config.getProperty("lanhu.appTab.shopAppTab","")

Guess you like

Origin www.cnblogs.com/li-lun/p/12175455.html