Hi
There is a problem that is specific to cp1255 in that there is a primary
character with more than 15 secondary variations.
I've split the first line up in cp1255.txt for lack of any better idea
of what to do.
The attached patch fixes both 1255 and unicode.
Steve
Index: src/uk/me/parabola/imgfmt/app/srt/Sort.java
===================================================================
--- src/uk/me/parabola/imgfmt/app/srt/Sort.java (revision 4285)
+++ src/uk/me/parabola/imgfmt/app/srt/Sort.java (working copy)
@@ -135,7 +135,7 @@
for (int i = 0; i < 256; i++) {
if (((p.flags[i] >>> 4) & 0xf) == 0) {
if (p.getPrimary(i) != 0) {
- byte second = p.getSecondary(i);
+ int second = p.getSecondary(i);
maxSecondary = Math.max(maxSecondary, second);
if (second != 0) {
maxTertiary = Math.max(maxTertiary, p.getTertiary(i));
@@ -361,7 +361,7 @@
// We need +1 for the null bytes, we also +2 for a couple of expanded characters. For a complete
// german map this was always enough in tests.
byte[] key = new byte[(chars.length + 1 + 2) * 4];
- int needed = 0;
+ int needed;
try {
needed = fillCompleteKey(chars, key);
} catch (ArrayIndexOutOfBoundsException e) {
@@ -597,7 +597,7 @@
/**
* Allocate space for up to n pages.
- * @param n
+ * @param n Number of pages
*/
public void setMaxPage(int n) {
pages = Arrays.copyOf(pages, n + 1);
@@ -634,8 +634,8 @@
primary[ch & 0xff] = (char) val;
}
- byte getSecondary(int ch) {
- return secondary[ch & 0xff];
+ int getSecondary(int ch) {
+ return secondary[ch & 0xff] & 0xff;
}
void setSecondary(int ch, int val) {
@@ -642,8 +642,8 @@
secondary[ch & 0xff] = (byte) val;
}
- byte getTertiary(int ch) {
- return tertiary[ch & 0xff];
+ int getTertiary(int ch) {
+ return tertiary[ch & 0xff] & 0xff;
}
void setTertiary(int ch, int val) {
@@ -850,7 +850,7 @@
}
// Get the first non-ignorable at this level
- int c = chars[(pos++ & 0xff)];
+ int c = chars[pos++ & 0xff];
if (!hasPage(c >>> 8)) {
next = 0;
continue;
Index: resources/sort/cp1255.txt
===================================================================
--- resources/sort/cp1255.txt (revision 4285)
+++ resources/sort/cp1255.txt (working copy)
@@ -5,7 +5,8 @@
characters
-=0008=000e=000f=0010=0011=0012=0013=0014=0015=0016=0017=0018=0019=001a=001b=001c=001d=001e=001f=007f=00ad=05bd=200e=200f,0001,0002,0003,0004,0005,0006,0007 ; 05b0 ; 05b1 ; 05b2 ; 05b3 ; 05b4 ; 05b5 ; 05b6 ; 05b7 ; 05b8 ; 05b9 ; 05bb ; 05c2 ; 05c1 ; 05bc ; 05bf
+=0008=000e=000f=0010=0011=0012=0013=0014=0015=0016=0017=0018=0019=001a=001b=001c=001d=001e=001f=007f=00ad=05bd=200e=200f,0001,0002,0003,0004,0005,0006,0007
+ < 05b0 ; 05b1 ; 05b2 ; 05b3 ; 05b4 ; 05b5 ; 05b6 ; 05b7 ; 05b8 ; 05b9 ; 05bb ; 05c2 ; 05c1 ; 05bc ; 05bf
< 0009
< 000a
< 000b
_______________________________________________
mkgmap-dev mailing list
[email protected]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev