Changeset 1619 in josm for trunk/src/org


Ignore:
Timestamp:
2009-05-24T18:35:56+02:00 (16 years ago)
Author:
stoecker
Message:

hopefully fixed UTF-8 problems in plugin info - #2596

File:
1 edited

Legend:

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

    r1591 r1619  
    99
    1010import java.io.BufferedReader;
     11import java.io.BufferedWriter;
    1112import java.io.File;
    1213import java.io.FileNotFoundException;
     
    1819import java.io.InputStreamReader;
    1920import java.io.OutputStream;
     21import java.io.OutputStreamWriter;
    2022import java.net.MalformedURLException;
    2123import java.net.URL;
     
    8486            try {
    8587                BufferedReader r = new BufferedReader(new InputStreamReader(new URL(site).openStream(), "utf-8"));
    86                 StringBuilder b = new StringBuilder();
     88                new File(Main.pref.getPreferencesDir()+"plugins").mkdir();
     89                BufferedWriter out = new BufferedWriter(new OutputStreamWriter(
     90                new FileOutputStream(new File(Main.pref.getPluginsDirFile(),
     91                count + "-site-" + site.replaceAll("[/:\\\\ <>|]", "_") + ".txt")), "utf-8"));
    8792                for (String line = r.readLine(); line != null; line = r.readLine())
    88                     b.append(line+"\n");
     93                    out.append(line+"\n");
    8994                r.close();
    90                 new File(Main.pref.getPreferencesDir()+"plugins").mkdir();
    91                 FileWriter out = new FileWriter(new File(Main.pref
    92                         .getPluginsDirFile(), count + "-site-"
    93                         + site.replaceAll("[/:\\\\ <>|]", "_") + ".txt"));
    94                 out.append(b);
    9595                out.close();
    9696                count++;
Note: See TracChangeset for help on using the changeset viewer.