Changeset 3084 in josm for trunk/src


Ignore:
Timestamp:
2010-03-05T11:39:42+01:00 (10 years ago)
Author:
Gubaer
Message:

fixed #4660: Local plugin list does not display umlauts
Local cache now encoded in UTF-8 too. You have to remove your cached plugin lists or download the plugin list in the plugin preferences.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/plugins/ReadRemotePluginInformationTask.java

    r3083 r3084  
    77import java.io.ByteArrayInputStream;
    88import java.io.File;
    9 import java.io.FileWriter;
     9import java.io.FileOutputStream;
    1010import java.io.IOException;
    1111import java.io.InputStream;
    1212import java.io.InputStreamReader;
     13import java.io.OutputStreamWriter;
    1314import java.io.PrintWriter;
    1415import java.io.UnsupportedEncodingException;
     
    121122                connection.setRequestProperty("User-Agent",Version.getInstance().getAgentString());
    122123                connection.setRequestProperty("Host", url.getHost());
     124                connection.setRequestProperty("Accept-Charset", "utf-8");
    123125            }
    124126            in = new BufferedReader(new InputStreamReader(connection.getInputStream(), "UTF-8"));
     
    169171            File cacheFile = new File(pluginDir, createSiteCacheFileName(site));
    170172            getProgressMonitor().subTask(tr("Writing plugin list to local cache ''{0}''", cacheFile.toString()));
    171             writer = new PrintWriter(
    172                     new FileWriter(cacheFile)
    173             );
    174             writer.print(list);
     173            writer = new PrintWriter(new OutputStreamWriter(new FileOutputStream(cacheFile), "utf-8"));
     174            writer.write(list);
    175175        } catch(IOException e) {
    176176            // just failed to write the cache file. No big deal, but log the exception anyway
Note: See TracChangeset for help on using the changeset viewer.