diff --git a/renren-generator/src/main/java/io/renren/utils/GenUtils.java b/renren-generator/src/main/java/io/renren/utils/GenUtils.java index 51f5548e..720b5c1e 100644 --- a/renren-generator/src/main/java/io/renren/utils/GenUtils.java +++ b/renren-generator/src/main/java/io/renren/utils/GenUtils.java @@ -168,7 +168,11 @@ public static String tableToJava(String tableName, String tablePrefix) { */ public static Configuration getConfig(){ try { - return new PropertiesConfiguration("generator.properties"); + //return new PropertiesConfiguration("generator.properties");//此方法没有指定编码,对中文不支持 + PropertiesConfiguration propertiesConfiguration = new PropertiesConfiguration(); + propertiesConfiguration.setEncoding("UTF-8"); + propertiesConfiguration.load("generator.properties"); + return propertiesConfiguration; } catch (ConfigurationException e) { throw new RRException("获取配置文件失败,", e); }