This patch lets you set --code-page=932; with it, mkgmap outputs maps
with proper Japanese characters for my Oregon 300. It disables
transliteration.
To display on my unit, I use modified fonts that include Asian
characters, which I downloaded from:
http://download.garmin.com/tw/download/TW_MAINWEB_UPGRADE/nuvi200_TWN_v410.exe
using instructions from:
http://www.malfreemaps.com/viewtopic.php?f=11&t=289&start=20
My resulting font files in Garmin\ExtData are:
006-D0952-05.bin 2,378,440 bytes
006-D0952-06.bin 8,006,800 bytes
Can others verify that it also works for them?
I'm a Java newbie, so the implementation may be sub-optimal.
Kimon
diff -rupN
mkgmap-r1995-orig\src/uk/me/parabola/imgfmt/app/labelenc/CodeFunctions.java
mkgmap-r1995\src/uk/me/parabola/imgfmt/app/labelenc/CodeFunctions.java
--- mkgmap-r1995-orig\src/uk/me/parabola/imgfmt/app/labelenc/CodeFunctions.java
2011-06-23 08:37:10.000000000 -0600
+++ mkgmap-r1995\src/uk/me/parabola/imgfmt/app/labelenc/CodeFunctions.java
2011-10-09 12:36:47.685732300 -0600
@@ -98,6 +98,14 @@ public class CodeFunctions {
} else if ("simple8".equals(charset)) {
funcs.setEncodingType(ENCODING_FORMAT9);
funcs.setEncoder(new Simple8Encoder());
+ } else if ("cp932".equals(charset) || "ms932".equals(charset)) {
+ funcs.setEncodingType(ENCODING_FORMAT10);
+ funcs.setEncoder(new AnyCharsetEncoder("ms932"));
+ funcs.setDecoder(new AnyCharsetDecoder("ms932"));
+ Transliterator transliterator = new
NullTransliterator();
+ funcs.setTransliterator(transliterator);
+ funcs.setCodepage(932);
+
} else {
funcs.setEncodingType(ENCODING_FORMAT9);
funcs.setDecoder(new AnyCharsetDecoder(charset));
@@ -152,6 +160,10 @@ public class CodeFunctions {
funcs.setEncodingType(ENCODING_FORMAT6);
funcs.setEncoder(new Format6Encoder());
funcs.setDecoder(new Format6Decoder());
+ } else if (codePage == 932) {
+ funcs.setEncodingType(ENCODING_FORMAT10);
+ funcs.setEncoder(new AnyCharsetEncoder("ms932"));
+ funcs.setDecoder(new AnyCharsetDecoder("ms932"));
} else if (format == ENCODING_FORMAT9) {
funcs.setEncodingType(ENCODING_FORMAT9);
String cpName = "cp" + codePage;
diff -rupN mkgmap-r1995-orig\src/uk/me/parabola/imgfmt/app/srt/Sort.java
mkgmap-r1995\src/uk/me/parabola/imgfmt/app/srt/Sort.java
--- mkgmap-r1995-orig\src/uk/me/parabola/imgfmt/app/srt/Sort.java
2011-06-23 08:34:55.000000000 -0600
+++ mkgmap-r1995\src/uk/me/parabola/imgfmt/app/srt/Sort.java 2011-10-09
12:34:11.510799600 -0600
@@ -194,6 +194,10 @@ public class Sort {
this.codepage = codepage;
if (codepage == 0)
charset = Charset.forName("cp1252");
+ else if (codepage == 932)
+ // Java uses "ms932" for code page 932
+ // (Windows-31J, Shift-JIS + MS extensions)
+ charset = Charset.forName("ms932");
else
charset = Charset.forName("cp" + codepage);
encoder = charset.newEncoder();
_______________________________________________
mkgmap-dev mailing list
[email protected]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev