Skip to content

Commit

Permalink
Use constant for standard char set
Browse files Browse the repository at this point in the history
  • Loading branch information
jfree committed Jan 8, 2023
1 parent bd70ae5 commit 12e7d36
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main/java/org/jfree/svg/SVGUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* JFreeSVG : an SVG library for the Java(tm) platform
* ===================================================
*
* (C)opyright 2013-2022, by David Gilbert. All rights reserved.
* (C)opyright 2013-present, by David Gilbert. All rights reserved.
*
* Project Info: http://www.jfree.org/jfreesvg/index.html
*
Expand Down Expand Up @@ -38,6 +38,7 @@
import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.nio.charset.StandardCharsets;
import java.util.function.DoubleFunction;
import java.util.logging.Level;
import java.util.logging.Logger;
Expand Down Expand Up @@ -140,7 +141,7 @@ public static void writeToSVG(File file, String svgElement, boolean zip)
if (zip) {
os = new GZIPOutputStream(os);
}
OutputStreamWriter osw = new OutputStreamWriter(os, "UTF-8");
OutputStreamWriter osw = new OutputStreamWriter(os, StandardCharsets.UTF_8);
writer = new BufferedWriter(osw);
writer.write("<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n");
writer.write(svgElement + "\n");
Expand Down Expand Up @@ -170,7 +171,7 @@ public static void writeToHTML(File file, String title, String svgElement)
BufferedWriter writer = null;
try {
FileOutputStream fos = new FileOutputStream(file);
OutputStreamWriter osw = new OutputStreamWriter(fos, "UTF-8");
OutputStreamWriter osw = new OutputStreamWriter(fos, StandardCharsets.UTF_8);
writer = new BufferedWriter(osw);
writer.write("<!DOCTYPE html>\n");
writer.write("<html>\n");
Expand Down

0 comments on commit 12e7d36

Please sign in to comment.