public static void convertSvgFile2Png(File svg, File png)
throws IOException, TranscoderException {
InputStream in = new FileInputStream(svg);
InputStreamReader is = new InputStreamReader(in);
OutputStream out = new FileOutputStream(png);
FileOutputStream fos = new FileOutputStream(png);
// OutputStreamWriter out = new OutputStreamWriter(fos, "UTF-8");
Transcoder transcoder = new PNGTranscoder();
TranscoderInput input = new TranscoderInput(is);
TranscoderOutput output = new TranscoderOutput(out);
transcoder.transcode(input, output);
in.close();
out.flush();
out.close();
}
环境是这样的,本来本人本地的是GBK,本人全用的GBK,转出来没问题,
但现在问题的服务器上是UTF-8的环境,所以本人把InputStream 改为了UTF-8
本来想把OutputStream也改为Utf-8,但是TranscoderOutput 他不接受OutputStreamWriter 类型,
求大家帮看看,这样的问题怎么解决啊,TranscoderOutput 这个也没看到设置编码的东西,
两个文件都是设置的UTF-8,没有乱码.
解决方案:100分
什么叫全部 可以一个一个的取的 建议你再开一个贴 正则的贴很多人回的