Re: [mkgmap-dev] Problem with an empty CodePage key in TYP.txt

2018-02-02 Thread Steve Ratcliffe

Hi Bernd


TYPwiz creates an empty key 'CodePage=' in my styles_typ.txt every time i had
changed this file, this leads to an error message at the end of the build
process.


The error can be fixed in mkgmap and I've attached a patch to
do so.  I will commit this tomorrow as it is fairly straightforward.

Best wishes,
Steve
Index: src/uk/me/parabola/mkgmap/main/TypCompiler.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===
--- src/uk/me/parabola/mkgmap/main/TypCompiler.java	(revision 4100)
+++ src/uk/me/parabola/mkgmap/main/TypCompiler.java	(date 1517590268000)
@@ -246,10 +246,11 @@
 	if (line.charAt(0) == 0xfeff)
 		return;
 
-	if (line.startsWith("CodePage")) {
+	if (line.startsWith("CodePage=")) {
 		String[] split = line.split("=");
 		try {
-			setCodePage("cp" + Integer.decode(split[1].trim()));
+			if (split.length > 1)
+setCodePage("cp" + Integer.decode(split[1].trim()));
 		} catch (NumberFormatException e) {
 			setCodePage("cp1252");
 		}
Index: src/uk/me/parabola/mkgmap/typ/TypTextReader.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===
--- src/uk/me/parabola/mkgmap/typ/TypTextReader.java	(revision 4100)
+++ src/uk/me/parabola/mkgmap/typ/TypTextReader.java	(date 1517591167000)
@@ -65,6 +65,9 @@
 	break;
 }
 			} else {
+if (currentSection == null)
+	throw new SyntaxException(scanner, "Missing section start");
+
 // Line inside a section
 String name = tok.getValue();
 
@@ -74,9 +77,6 @@
 
 String value = scanner.readLine();
 
-if (currentSection == null)
-	throw new SyntaxException(scanner, "Missing section start");
-
 currentSection.processLine(scanner, name, value);
 			}
 			scanner.skipSpace();
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Re: [mkgmap-dev] Problem with an empty CodePage key in TYP.txt

2018-02-02 Thread osm@pinns

Hi Bend

I think this should be in TYPWiz and perhaps a warning in mkgmap that 
codepages cant be 0


Nick


On 02/02/2018 16:21, Bernd Weigelt wrote:

Hello

TYPwiz creates an empty key 'CodePage=' in my styles_typ.txt every time i had
changed this file, this leads to an error message at the end of the build
process.
I don't know if this line is needed, but i can't see any problem, when i
comment this key out, made it for very much builds.

Should this problem fixed in MKGMAP or better in TYPwiz?


Bernd

;generated by TYPWiz 5,82
;created : 02-01-2018
;--
[_id]
ProductCode=46
FID=5
;Header=5B
CodePage=
[end]



II: building basemap
Time started: Fri Feb 02 16:58:17 CET 2018
java.lang.ArrayIndexOutOfBoundsException: 1
 at uk.me.parabola.mkgmap.main.TypCompiler
$CharsetProbe.tryCharset(TypCompiler.java:252)
 at uk.me.parabola.mkgmap.main.TypCompiler
$CharsetProbe.probeCharset(TypCompiler.java:222)
 at uk.me.parabola.mkgmap.main.TypCompiler$CharsetProbe.access
$000(TypCompiler.java:205)
 at uk.me.parabola.mkgmap.main.TypCompiler.makeMap(TypCompiler.java:67)
 at uk.me.parabola.mkgmap.main.Main$1.call(Main.java:263)
 at uk.me.parabola.mkgmap.main.Main$1.call(Main.java:259)
 at java.util.concurrent.FutureTask.run(FutureTask.java:266)
 at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:
1149)
 at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:624)
 at java.lang.Thread.run(Thread.java:748)
Number of MapFailedExceptions: 0
Number of ExitExceptions: 0
Time finished: Fri Feb 02 17:01:42 CET 2018
Total time taken: 205566ms







___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

[mkgmap-dev] Problem with an empty CodePage key in TYP.txt

2018-02-02 Thread Bernd Weigelt
Hello

TYPwiz creates an empty key 'CodePage=' in my styles_typ.txt every time i had 
changed this file, this leads to an error message at the end of the build 
process.
I don't know if this line is needed, but i can't see any problem, when i 
comment this key out, made it for very much builds.

Should this problem fixed in MKGMAP or better in TYPwiz?


Bernd

;generated by TYPWiz 5,82
;created : 02-01-2018
;--
[_id]
ProductCode=46
FID=5
;Header=5B
CodePage=
[end]



II: building basemap
Time started: Fri Feb 02 16:58:17 CET 2018
java.lang.ArrayIndexOutOfBoundsException: 1
at uk.me.parabola.mkgmap.main.TypCompiler
$CharsetProbe.tryCharset(TypCompiler.java:252)
at uk.me.parabola.mkgmap.main.TypCompiler
$CharsetProbe.probeCharset(TypCompiler.java:222)
at uk.me.parabola.mkgmap.main.TypCompiler$CharsetProbe.access
$000(TypCompiler.java:205)
at uk.me.parabola.mkgmap.main.TypCompiler.makeMap(TypCompiler.java:67)
at uk.me.parabola.mkgmap.main.Main$1.call(Main.java:263)
at uk.me.parabola.mkgmap.main.Main$1.call(Main.java:259)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:
1149)
at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Number of MapFailedExceptions: 0
Number of ExitExceptions: 0
Time finished: Fri Feb 02 17:01:42 CET 2018
Total time taken: 205566ms







signature.asc
Description: This is a digitally signed message part.
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev