- Timestamp:
- 2014-05-09T14:36:55+02:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/io/DownloadFileTask.java
r7033 r7089 14 14 import java.net.MalformedURLException; 15 15 import java.net.URL; 16 import java.nio.charset.StandardCharsets; 16 17 import java.util.Enumeration; 17 18 import java.util.zip.ZipEntry; … … 169 170 */ 170 171 public static void unzipFileRecursively(File file, String dir) throws IOException { 171 try (ZipFile zf = new ZipFile(file )) {172 try (ZipFile zf = new ZipFile(file, StandardCharsets.UTF_8)) { 172 173 Enumeration<? extends ZipEntry> es = zf.entries(); 173 174 while (es.hasMoreElements()) { -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java
r7083 r7089 162 162 File file = in.getFile(); 163 163 Utils.close(in); 164 zipFile = new ZipFile(file );164 zipFile = new ZipFile(file, StandardCharsets.UTF_8); 165 165 zipIcons = file; 166 166 ZipEntry zipEntry = zipFile.getEntry(zipEntryPath); -
trunk/src/org/openstreetmap/josm/io/Compression.java
r7033 r7089 1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.io; 3 4 import org.apache.tools.bzip2.CBZip2OutputStream;5 import org.openstreetmap.josm.tools.Utils;6 3 7 4 import java.io.File; … … 12 9 import java.io.OutputStream; 13 10 import java.net.URL; 11 import java.nio.charset.StandardCharsets; 14 12 import java.util.zip.GZIPOutputStream; 15 13 import java.util.zip.ZipOutputStream; 14 15 import org.apache.tools.bzip2.CBZip2OutputStream; 16 import org.openstreetmap.josm.tools.Utils; 16 17 17 18 /** … … 103 104 return new GZIPOutputStream(out); 104 105 case ZIP: 105 return new ZipOutputStream(out );106 return new ZipOutputStream(out, StandardCharsets.UTF_8); 106 107 case NONE: 107 108 default: -
trunk/src/org/openstreetmap/josm/io/FileImporter.java
r6882 r7089 8 8 import java.io.IOException; 9 9 import java.io.InputStream; 10 import java.nio.charset.StandardCharsets; 10 11 import java.util.List; 11 12 import java.util.zip.GZIPInputStream; … … 162 163 return null; 163 164 } 164 ZipInputStream zis = new ZipInputStream(in );165 ZipInputStream zis = new ZipInputStream(in, StandardCharsets.UTF_8); 165 166 // Positions the stream at the beginning of first entry 166 167 ZipEntry ze = zis.getNextEntry(); -
trunk/src/org/openstreetmap/josm/io/MirroredInputStream.java
r7081 r7089 15 15 import java.net.MalformedURLException; 16 16 import java.net.URL; 17 import java.nio.charset.StandardCharsets; 17 18 import java.util.ArrayList; 18 19 import java.util.Arrays; … … 39 40 /** 40 41 * Constructs an input stream from a given filename, URL or internal resource. 41 * 42 * 42 43 * @param name can be:<ul> 43 44 * <li>relative or absolute file name</li> … … 54 55 /** 55 56 * Constructs an input stream from a given filename, URL or internal resource. 56 * 57 * 57 58 * @param name can be:<ul> 58 59 * <li>relative or absolute file name</li> … … 70 71 /** 71 72 * Constructs an input stream from a given filename, URL or internal resource. 72 * 73 * 73 74 * @param name can be:<ul> 74 75 * <li>relative or absolute file name</li> … … 86 87 /** 87 88 * Constructs an input stream from a given filename, URL or internal resource. 88 * 89 * 89 90 * @param name can be:<ul> 90 91 * <li>relative or absolute file name</li> … … 103 104 /** 104 105 * Constructs an input stream from a given filename, URL or internal resource. 105 * 106 * 106 107 * @param name can be:<ul> 107 108 * <li>relative or absolute file name</li> … … 121 122 /** 122 123 * Constructs an input stream from a given filename, URL or internal resource. 123 * 124 * 124 125 * @param name can be:<ul> 125 126 * <li>relative or absolute file name</li> … … 200 201 Pair<String, InputStream> res = null; 201 202 try { 202 ZipFile zipFile = new ZipFile(file );203 ZipFile zipFile = new ZipFile(file, StandardCharsets.UTF_8); 203 204 ZipEntry resentry = null; 204 205 Enumeration<? extends ZipEntry> entries = zipFile.entries(); … … 239 240 cleanup(name, null); 240 241 } 241 242 242 243 public static void cleanup(String name, String destDir) { 243 244 URL url; … … 349 350 * <p> 350 351 * This can causes problems when downloading from certain GitHub URLs. 351 * 352 * 352 353 * @param downloadUrl The resource URL to download 353 354 * @param httpAccept The accepted MIME types sent in the HTTP Accept header. Can be {@code null} -
trunk/src/org/openstreetmap/josm/io/session/SessionReader.java
r7083 r7089 13 13 import java.net.URI; 14 14 import java.net.URISyntaxException; 15 import java.nio.charset.StandardCharsets; 15 16 import java.util.ArrayList; 16 17 import java.util.Collections; … … 559 560 if (zip) { 560 561 try { 561 zipFile = new ZipFile(sessionFile );562 zipFile = new ZipFile(sessionFile, StandardCharsets.UTF_8); 562 563 return getZipInputStream(zipFile); 563 564 } catch (ZipException ze) { -
trunk/src/org/openstreetmap/josm/io/session/SessionWriter.java
r7082 r7089 249 249 public void write(OutputStream out) throws IOException { 250 250 if (zip) { 251 zipOut = new ZipOutputStream(new BufferedOutputStream(out) );251 zipOut = new ZipOutputStream(new BufferedOutputStream(out), StandardCharsets.UTF_8); 252 252 } 253 253 Document doc = createJosDocument(); // as side effect, files may be added to zipOut -
trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
r7082 r7089 598 598 599 599 private static ImageResource getIfAvailableZip(String fullName, File archive, String inArchiveDir, ImageType type) { 600 try (ZipFile zipFile = new ZipFile(archive )) {600 try (ZipFile zipFile = new ZipFile(archive, StandardCharsets.UTF_8)) { 601 601 if (inArchiveDir == null || ".".equals(inArchiveDir)) { 602 602 inArchiveDir = "";
Note:
See TracChangeset
for help on using the changeset viewer.