URL using non ASCII characters [utf-8 support] #5
https://github.com/dfabulich/sitemapgen4j/issues/5#issuecomment-82243209
This commit is contained in:
parent
c2d956cd06
commit
895cac17a6
|
@ -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