Merge pull request #6 from hoteia/master

URL using non ASCII characters [utf-8 support] #5
This commit is contained in:
dfabulich 2015-03-24 08:21:09 -07:00
commit c24db4203b
1 changed files with 3 additions and 3 deletions

View File

@ -2,11 +2,11 @@ package com.redfin.sitemapgenerator;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.net.MalformedURLException;
import java.net.URL;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;
import java.util.zip.GZIPOutputStream;
@ -193,9 +193,9 @@ abstract class SitemapGenerator<U extends ISitemapUrl, THIS extends SitemapGener
if (gzip) {
FileOutputStream fileStream = new FileOutputStream(outFile);
GZIPOutputStream gzipStream = new GZIPOutputStream(fileStream);
out = new OutputStreamWriter(gzipStream);
out = new OutputStreamWriter(gzipStream, Charset.forName("UTF-8").newEncoder());
} else {
out = new FileWriter(outFile);
out = new OutputStreamWriter(new FileOutputStream(outFile), Charset.forName("UTF-8").newEncoder());
}
writeSiteMap(out);