大家看下部分代码public ServiceConfig readFromFile(File configFile) throws InvalidConfigException
{
if(configFile == null)
{
return null;
}
FileReader fr = null;
try
{
fr = new FileReader(configFile);
String cmd=fr.getEncoding();
return this.read(fr);
}
catch (FileNotFoundException e)
{
logger.error("逻辑接口配置失败["+configFile.getAbsolutePath()+"]!");
throw new InvalidConfigException(e);
}
}我用jdom解析xml文件出现乱码,大家看下红字部分,我发现变量cmd=gb2312,
我想,问题可能就出在这里,我想把字符集换成utf-8,不知道怎么设置,请求帮助