Merge pull request #6 from hoteia/master
URL using non ASCII characters [utf-8 support] #5
This commit is contained in:
commit
c24db4203b
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue