- Timestamp:
- 2012-01-16T19:00:24+01:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/preferences/AddWMSLayerPanel.java
r4801 r4802 18 18 import java.io.IOException; 19 19 import java.io.InputStream; 20 import java.io.InputStreamReader;21 20 import java.io.StringReader; 22 21 import java.net.MalformedURLException; … … 60 59 import org.openstreetmap.josm.gui.bbox.SlippyMapBBoxChooser; 61 60 import org.openstreetmap.josm.gui.layer.TMSLayer; 61 import org.openstreetmap.josm.io.UTFInputStreamReader; 62 62 import org.openstreetmap.josm.tools.GBC; 63 63 import org.w3c.dom.Document; … … 344 344 URLConnection openConnection = getCapabilitiesUrl.openConnection(); 345 345 InputStream inputStream = openConnection.getInputStream(); 346 BufferedReader br = new BufferedReader( new InputStreamReader(inputStream, "UTF-8"));346 BufferedReader br = new BufferedReader(UTFInputStreamReader.create(inputStream, "UTF-8")); 347 347 String line; 348 348 StringBuilder ba = new StringBuilder(); 349 boolean isFirstLine = true;350 349 while ((line = br.readLine()) != null) { 351 // fix #7271352 // see http://www.rgagnon.com/javadetails/java-handle-utf8-file-with-bom.html353 final String UTF8_BOM = "\uFEFF";354 if (isFirstLine && line.startsWith(UTF8_BOM)) {355 System.out.println("Removing UTF8_BOM (0xFEFF) from GetCapabilities response");356 line = line.substring(1);357 isFirstLine = false;358 }359 350 ba.append(line); 360 351 ba.append("\n");
Note:
See TracChangeset
for help on using the changeset viewer.