Hi Patrik
If there's anything to be tested, just let me know.... I would just need
patched/updated mkgmap as I'm not the Java Crack in terms of
compilations...
This simply opens the file for read using utf-8.
Patch attached and pre-compiled jar file is here:
http://files.mkgmap.org.uk/download/315/mkgmap.jar
Let me know what happens.
..Steve
Index: src/uk/me/parabola/mkgmap/reader/osm/OsmMapDataSource.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/uk/me/parabola/mkgmap/reader/osm/OsmMapDataSource.java (revision 3704)
+++ src/uk/me/parabola/mkgmap/reader/osm/OsmMapDataSource.java (revision )
@@ -17,11 +17,12 @@
package uk.me.parabola.mkgmap.reader.osm;
import java.io.BufferedReader;
-import java.io.File;
+import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
+import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
@@ -141,10 +142,10 @@
String copyrightFileName = getConfig().getProperty("copyright-file", null);
if (copyrightFileName != null)
{
- File file = new File(copyrightFileName);
List<String> copyrightArray = new ArrayList<String>();
try {
- BufferedReader reader = new BufferedReader(new FileReader(file));
+ InputStream is = new FileInputStream(copyrightFileName);
+ BufferedReader reader = new BufferedReader(new InputStreamReader(is, "utf-8"));
String text;
while ((text = reader.readLine()) != null) {
copyrightArray.add(text);
Index: src/uk/me/parabola/mkgmap/build/MapBuilder.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/uk/me/parabola/mkgmap/build/MapBuilder.java (revision 3704)
+++ src/uk/me/parabola/mkgmap/build/MapBuilder.java (revision )
@@ -15,9 +15,10 @@
import java.io.BufferedReader;
import java.io.File;
+import java.io.FileInputStream;
import java.io.FileNotFoundException;
-import java.io.FileReader;
import java.io.IOException;
+import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
@@ -27,8 +28,6 @@
import java.util.List;
import java.util.Set;
-import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap;
-
import uk.me.parabola.imgfmt.ExitException;
import uk.me.parabola.imgfmt.Utils;
import uk.me.parabola.imgfmt.app.Coord;
@@ -95,6 +94,8 @@
import uk.me.parabola.util.Configurable;
import uk.me.parabola.util.EnhancedProperties;
+import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap;
+
/**
* This is the core of the code to translate from the general representation
* into the garmin representation.
@@ -821,16 +822,12 @@
/**
* Set all the information that appears in the header.
- *
- * @param map The map to write to.
- * @param src The source of map information.
*/
protected void getMapInfo() {
if (licenseFileName != null) {
- File file = new File(licenseFileName);
-
try {
- BufferedReader reader = new BufferedReader(new FileReader(file));
+ FileInputStream is = new FileInputStream(licenseFileName);
+ BufferedReader reader = new BufferedReader(new InputStreamReader(is, "utf-8"));
String text;
// repeat until all lines is read
_______________________________________________
mkgmap-dev mailing list
[email protected]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev