@@ -3317,11 +3317,11 @@ public static void testHdf4() throws Exception {
33173317 String[] list = RegexFilenameFilter.recursiveFullNameList(
33183318 "c:/programs/_tomcat/webapps/cwexperimental/WEB-INF/classes/ucar4", ".*\\.java", false);
33193319 for (int i = 0; i < list.length; i++) {
3320- String content[] = File2.readFromFile (list[i]);
3320+ String content[] = File2.readFromFileUtf8 (list[i]);
33213321 if (content[0].length() == 0) {
33223322 String2.log("processing " + list[i]);
33233323 content[1] = String2.replaceAll(content[1], "ucar.", "ucar4.");
3324- File2.writeToFile (list[i], content[1]);
3324+ File2.writeToFileUtf8 (list[i], content[1]);
33253325 } else {
33263326 String2.log(content[0]);
33273327 }
@@ -6367,7 +6367,7 @@ public static void nodcPJJU(
63676367 for (int f = 0; f < fileNames.length; f++) {
63686368 try {
63696369 String2.log("\n#" + f + " " + fileNames[f]);
6370- ArrayList<String> lines = File2.readLinesFromFile(inDir + fileNames[f], null , 2);
6370+ ArrayList<String> lines = File2.readLinesFromFile(inDir + fileNames[f], File2.ISO_8859_1 , 2);
63716371
63726372 //BOTTLE,20030711WHPSIODMB
63736373 //#code : jjward hyd_to_exchange.pl
@@ -6984,10 +6984,9 @@ public static String makeNetcheckErddapTests(String erddapUrl) throws Throwable
69846984 */
69856985 public static void fixKeywords(String fileName) throws Exception {
69866986 String2.log("fixKeywords " + fileName);
6987- String charset = File2.ISO_8859_1;
69886987 String attKeywords = "<att name=\"keywords\">";
69896988 int attKeywordsLength = attKeywords.length();
6990- StringArray lines = StringArray.fromFile (fileName, charset );
6989+ StringArray lines = StringArray.fromFileUtf8 (fileName);
69916990 int linesSize = lines.size();
69926991 for (int i = 0; i < linesSize; i++) {
69936992 //start keywords?
@@ -7012,7 +7011,7 @@ public static void fixKeywords(String fileName) throws Exception {
70127011 }
70137012 }
70147013 }
7015- lines.toFile(fileName);
7014+ lines.toFile(fileName, File2.UTF_8, null );
70167015 }
70177016
70187017 /**
@@ -7339,7 +7338,7 @@ public static void convertGlobecCsvToNc() throws Exception {
73397338 public static void splitRockfish() throws Exception {
73407339 String2.log("\n*** splitRockfish");
73417340 String fileDir = "c:/data/globec/";
7342- StringArray sa = StringArray.fromFile (fileDir + "rockfish_view.csv");
7341+ StringArray sa = StringArray.fromFile88591 (fileDir + "rockfish_view.csv");
73437342 int size = sa.size();
73447343
73457344 //this file has \N for missing values. change to ""
@@ -7352,7 +7351,7 @@ public static void splitRockfish() throws Exception {
73527351 while (size > 1) {
73537352 int stop = Math.min(100000, size - 1);
73547353 sa.subset(subset, 0, 1, stop); //stop is inclusive
7355- subset.toFile(fileDir + "rockfish" + (chunk++) + ".csv");
7354+ subset.toFile(fileDir + "rockfish" + (chunk++) + ".csv", File2.ISO_8859_1, null );
73567355 sa.removeRange(1, stop + 1); //end is exclusive
73577356 size = sa.size();
73587357 }
@@ -9504,7 +9503,7 @@ public static void makePH2Ncml(String sstdn)
95049503
95059504 //String names[] = RegexFilenameFilter.list(dir, regex);
95069505 ArrayList<String> names = File2.readLinesFromFile(
9507- "/u00/satellite/PH2/" + sstdn + "/names.txt", null , 1);
9506+ "/u00/satellite/PH2/" + sstdn + "/names.txt", File2.ISO_8859_1 , 1);
95089507
95099508 //for each file
95109509 int nNames = names.size();
@@ -9559,7 +9558,7 @@ public static void makePH53Ncml()
95599558 for (int daynight = 0; daynight < 2; daynight++) {
95609559
95619560 ArrayList<String> names = File2.readLinesFromFile(
9562- ncmlDir + dayNight[daynight] + "names" + year + ".txt", null , 1);
9561+ ncmlDir + dayNight[daynight] + "names" + year + ".txt", File2.ISO_8859_1 , 1);
95639562 HashMap<String,String> hm = new HashMap();
95649563 //for each file
95659564 //19811101145206-NODC-L3C_GHRSST-SSTskin-AVHRR_Pathfinder-PFV5.2_NOAA07_G_1981305_day-v02.0-fv01.0.nc
0 commit comments