[jruby-joni] 30/223: Add Emacs-Mule encoding impl.

Hideki Yamane henrich at moszumanska.debian.org
Mon Nov 16 11:21:42 UTC 2015


This is an automated email from the git hooks/post-receive script.

henrich pushed a commit to branch debian/sid
in repository jruby-joni.

commit 9d1ffe82309531f0763e46188d0bb79732ebdaa5
Author: Marcin Mielżyński <lopx at gazeta.pl>
Date:   Tue Aug 26 23:22:56 2008 +0000

    Add Emacs-Mule encoding impl.
    
    git-svn-id: http://svn.codehaus.org/jruby/joni/trunk@7554 961051c9-f516-0410-bf72-c9f7e237a7b7
---
 src/org/joni/encoding/specific/BIG5Encoding.java   |   2 +-
 src/org/joni/encoding/specific/CP1251Encoding.java |   2 +-
 src/org/joni/encoding/specific/EUCJPEncoding.java  |   4 +-
 src/org/joni/encoding/specific/EUCKREncoding.java  |   2 +-
 src/org/joni/encoding/specific/EUCTWEncoding.java  |   2 +-
 .../{EUCTWEncoding.java => EmacsMuleEncoding.java} | 191 +++++++++++++++------
 .../joni/encoding/specific/GB18030Encoding.java    |   2 +-
 src/org/joni/encoding/specific/KOI8Encoding.java   |   2 +-
 src/org/joni/encoding/specific/SJISEncoding.java   |   3 +-
 9 files changed, 146 insertions(+), 64 deletions(-)

diff --git a/src/org/joni/encoding/specific/BIG5Encoding.java b/src/org/joni/encoding/specific/BIG5Encoding.java
index e585e36..36d3f98 100644
--- a/src/org/joni/encoding/specific/BIG5Encoding.java
+++ b/src/org/joni/encoding/specific/BIG5Encoding.java
@@ -23,7 +23,7 @@ import org.joni.Config;
 import org.joni.IntHolder;
 import org.joni.encoding.CanBeTrailTableEncoding;
 
-public final class BIG5Encoding extends CanBeTrailTableEncoding  {
+public final class BIG5Encoding extends CanBeTrailTableEncoding {
 
     protected BIG5Encoding() {
         super(1, 2, Big5EncLen, BIG5Trans, ASCIIEncoding.AsciiCtypeTable, BIG5_CAN_BE_TRAIL_TABLE);
diff --git a/src/org/joni/encoding/specific/CP1251Encoding.java b/src/org/joni/encoding/specific/CP1251Encoding.java
index a95df79..5fab9c1 100644
--- a/src/org/joni/encoding/specific/CP1251Encoding.java
+++ b/src/org/joni/encoding/specific/CP1251Encoding.java
@@ -22,7 +22,7 @@ package org.joni.encoding.specific;
 import org.joni.IntHolder;
 import org.joni.encoding.CaseFoldMapEncoding;
 
-final public class CP1251Encoding extends CaseFoldMapEncoding  {
+final public class CP1251Encoding extends CaseFoldMapEncoding {
 
     protected CP1251Encoding() {
         super(CP1251_CtypeTable, CP1251_ToLowerCaseTable, CP1251_CaseFoldMap, false);
diff --git a/src/org/joni/encoding/specific/EUCJPEncoding.java b/src/org/joni/encoding/specific/EUCJPEncoding.java
index 47b166e..db49368 100644
--- a/src/org/joni/encoding/specific/EUCJPEncoding.java
+++ b/src/org/joni/encoding/specific/EUCJPEncoding.java
@@ -29,7 +29,7 @@ import org.joni.exception.InternalException;
 import org.joni.exception.ValueException;
 import org.joni.util.BytesHash;
 
-public final class EUCJPEncoding extends EucEncoding  {
+public final class EUCJPEncoding extends EucEncoding {
 
     protected EUCJPEncoding() {
         super(1, 3, EUCJPEncLen, EUCJPTrans, ASCIIEncoding.AsciiCtypeTable);
@@ -75,7 +75,7 @@ public final class EUCJPEncoding extends EucEncoding  {
         if ((code &   0xff00) != 0) bytes[p_++] = (byte)((code >>  8) & 0xff);
         bytes[p_++] = (byte)(code & 0xff);
         
-        if (length(bytes, p, p_) != p_ - p) throw new InternalException(ErrorMessages.ERR_INVALID_CODE_POINT_VALUE);
+        if (length(bytes, p, p_) != p_ - p) throw new ValueException(ErrorMessages.ERR_INVALID_CODE_POINT_VALUE);
         return p_ - p;
     }
     
diff --git a/src/org/joni/encoding/specific/EUCKREncoding.java b/src/org/joni/encoding/specific/EUCKREncoding.java
index 56632e3..f645879 100644
--- a/src/org/joni/encoding/specific/EUCKREncoding.java
+++ b/src/org/joni/encoding/specific/EUCKREncoding.java
@@ -23,7 +23,7 @@ import org.joni.Config;
 import org.joni.IntHolder;
 import org.joni.encoding.EucEncoding;
 
-public final class EUCKREncoding extends EucEncoding  {
+public final class EUCKREncoding extends EucEncoding {
 
     protected EUCKREncoding() {
         super(1, 2, EUCKREncLen, EUCKRTrans, ASCIIEncoding.AsciiCtypeTable);
diff --git a/src/org/joni/encoding/specific/EUCTWEncoding.java b/src/org/joni/encoding/specific/EUCTWEncoding.java
index 7d3c8aa..f10e789 100644
--- a/src/org/joni/encoding/specific/EUCTWEncoding.java
+++ b/src/org/joni/encoding/specific/EUCTWEncoding.java
@@ -23,7 +23,7 @@ import org.joni.Config;
 import org.joni.IntHolder;
 import org.joni.encoding.EucEncoding;
 
-public final class EUCTWEncoding extends EucEncoding  {
+public final class EUCTWEncoding extends EucEncoding {
 
     protected EUCTWEncoding() {
         super(1, 4, EUCTWEncLen, EUCTWTrans, ASCIIEncoding.AsciiCtypeTable);
diff --git a/src/org/joni/encoding/specific/EUCTWEncoding.java b/src/org/joni/encoding/specific/EmacsMuleEncoding.java
similarity index 50%
copy from src/org/joni/encoding/specific/EUCTWEncoding.java
copy to src/org/joni/encoding/specific/EmacsMuleEncoding.java
index 7d3c8aa..decde29 100644
--- a/src/org/joni/encoding/specific/EUCTWEncoding.java
+++ b/src/org/joni/encoding/specific/EmacsMuleEncoding.java
@@ -21,22 +21,24 @@ package org.joni.encoding.specific;
 
 import org.joni.Config;
 import org.joni.IntHolder;
-import org.joni.encoding.EucEncoding;
+import org.joni.encoding.MultiByteEncoding;
+import org.joni.exception.ErrorMessages;
+import org.joni.exception.ValueException;
 
-public final class EUCTWEncoding extends EucEncoding  {
+public final class EmacsMuleEncoding extends MultiByteEncoding {
 
-    protected EUCTWEncoding() {
-        super(1, 4, EUCTWEncLen, EUCTWTrans, ASCIIEncoding.AsciiCtypeTable);
+    protected EmacsMuleEncoding() {
+        super(1, 4, EmacsMuleEncLen, EmacsMuleTrans, ASCIIEncoding.AsciiCtypeTable);
     }
     
     @Override
     public String toString() {
-        return "EUC-TW";
+        return "Emacs-Mule";
     }
 
     @Override
     public int length(byte[]bytes, int p, int end) {
-        if (Config.VANILLA) {
+        if (Config.VANILLA){
             return length(bytes[p]);
         } else {
             return safeLengthForUptoFour(bytes, p, end);
@@ -45,51 +47,75 @@ public final class EUCTWEncoding extends EucEncoding  {
 
     @Override
     public int mbcToCode(byte[]bytes, int p, int end) {
-        return mbnMbcToCode(bytes, p, end);
+        return mbnMbcToCode(bytes, p, end) & 0x7FFFFFFF;
     }
     
     @Override
     public int codeToMbcLength(int code) {
-        return mb4CodeToMbcLength(code);
+        // TODO: this won't work with signed values, probably need to move to long or use bitwise 'and' and masks
+        if (isAscii(code)) {
+            return 1;
+        } else if (code > 0xffffffff) { 
+            return 0;
+        } else if ((code & 0xff000000) >= 0x80000000) {
+            return 4;
+        } else if ((code & 0xff0000) >= 0x800000) {
+            return 3;
+        } else if ((code & 0xff00) >= 0x8000) {
+            return 2;
+        }
+        throw new ValueException(ErrorMessages.ERR_INVALID_CODE_POINT_VALUE);
     }
     
     @Override
     public int codeToMbc(int code, byte[]bytes, int p) {
-        return mb4CodeToMbc(code, bytes, p);
+        int p_ = p;        
+        if ((code & 0xff000000) != 0)           bytes[p_++] = (byte)((code >>> 24) | 0x80);
+        if ((code & 0xff0000) != 0)             bytes[p_++] = (byte)((code >>> 16) & 0xff);
+        if ((code & 0xff00) != 0 )              bytes[p_++] = (byte)((code >>> 8) & 0xff);
+        bytes[p_++] = (byte)(code & 0xff);
+        
+        if (length(bytes, p, p_) != (p_ - p)) throw new ValueException(ErrorMessages.ERR_INVALID_CODE_POINT_VALUE);
+        return p_ - p;
     }
-    
+
     @Override
     public int mbcCaseFold(int flag, byte[]bytes, IntHolder pp, int end, byte[]lower) {
         return mbnMbcCaseFold(flag, bytes, pp, end, lower);
     }
-    
+
     @Override
     public boolean isCodeCType(int code, int ctype) {
-        return mb4IsCodeCType(code, ctype);
+        if (code < 128) {            
+            return isCodeCTypeInternal(code, ctype); // configured with ascii
+        } else {
+            return codeToMbcLength(code) > 1;
+        }
     }
-    
+
     @Override
     public int[]ctypeCodeRange(int ctype, IntHolder sbOut) {
         return null;
     }
-
-    // euckr_islead
-    protected boolean isLead(int c) {
-        if (Config.VANILLA) {
-            return ((c < 0xa1 && c != 0x8e) || c == 0xff);
-        } else {
-            return (c - 0xa1) > 0xfe - 0xa1;
-        }
+    
+    private static boolean islead(int c) {
+        return c - 0x81 > 0x9d - 0x81;
     }
-
-    @Override    
+    
+    @Override
+    public int leftAdjustCharHead(byte[] bytes, int p, int end) {
+        if (end <= p) return end;
+        int p_ = end;
+        while (!islead(bytes[p_]) && p_ > p) p_--;
+        return p_;
+    };
+    
+    @Override
     public boolean isReverseMatchAllowed(byte[]bytes, int p, int end) {
-        int c = bytes[p] & 0xff;
-        return c <= 0x7e;
+        return true;
     }
     
-    static final int EUCTWEncLen[] = {
-        1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+    static final int EmacsMuleEncLen[] = {
         1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
         1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
         1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -97,17 +123,18 @@ public final class EUCTWEncoding extends EucEncoding  {
         1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
         1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
         1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 1,
         1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
         1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
-        2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
-        2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
-        2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
-        2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
-        2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1
+        3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 1, 1,
+        1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+        1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+        1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+        1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+        1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+        1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
     };
 
-    private static final int EUCTWTrans[][] = Config.VANILLA ? null : new int[][]{
+    private static final int EmacsMuleTrans[][] = Config.VANILLA ? null : new int[][]{
         { /* S0   0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f */
           /* 0 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
           /* 1 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
@@ -117,14 +144,14 @@ public final class EUCTWEncoding extends EucEncoding  {
           /* 5 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
           /* 6 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
           /* 7 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
-          /* 8 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, 2, F,
-          /* 9 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
-          /* a */ F, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-          /* b */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-          /* c */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-          /* d */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-          /* e */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-          /* f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, F 
+          /* 8 */ F, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+          /* 9 */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 4, 5, 6, F, F,
+          /* a */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+          /* b */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+          /* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+          /* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+          /* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+          /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F
         },
         { /* S1   0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f */
           /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
@@ -137,12 +164,12 @@ public final class EUCTWEncoding extends EucEncoding  {
           /* 7 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
           /* 8 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
           /* 9 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
-          /* a */ F, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
+          /* a */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
           /* b */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
           /* c */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
           /* d */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
           /* e */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
-          /* f */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, F 
+          /* f */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A 
         },
         { /* S2   0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f */
           /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
@@ -155,12 +182,12 @@ public final class EUCTWEncoding extends EucEncoding  {
           /* 7 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
           /* 8 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
           /* 9 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
-          /* a */ F, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
-          /* b */ 3, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
-          /* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
-          /* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
-          /* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
-          /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F 
+          /* a */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+          /* b */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+          /* c */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+          /* d */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+          /* e */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+          /* f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 
         },
         { /* S3   0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f */
           /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
@@ -173,14 +200,68 @@ public final class EUCTWEncoding extends EucEncoding  {
           /* 7 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
           /* 8 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
           /* 9 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
-          /* a */ F, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+          /* a */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
           /* b */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
           /* c */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
           /* d */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+          /* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+          /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F
+        },
+        { /* S4   0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f */
+          /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+          /* 1 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+          /* 2 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+          /* 3 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+          /* 4 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+          /* 5 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+          /* 6 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+          /* 7 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+          /* 8 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+          /* 9 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+          /* a */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+          /* b */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+          /* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+          /* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
           /* e */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-          /* f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, F 
-        }
+          /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F
+        },
+        { /* S5   0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f */
+          /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+          /* 1 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+          /* 2 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+          /* 3 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+          /* 4 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+          /* 5 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+          /* 6 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+          /* 7 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+          /* 8 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+          /* 9 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+          /* a */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+          /* b */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+          /* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+          /* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+          /* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+          /* f */ 2, 2, 2, 2, 2, F, F, F, F, F, F, F, F, F, F, F
+        },
+        { /* S6   0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f */
+          /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+          /* 1 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+          /* 2 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+          /* 3 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+          /* 4 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+          /* 5 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+          /* 6 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+          /* 7 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+          /* 8 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+          /* 9 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+          /* a */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+          /* b */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+          /* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+          /* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+          /* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+          /* f */ F, F, F, F, F, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, F
+        },
     };
-
-    public static final EUCTWEncoding INSTANCE = new EUCTWEncoding();
+    
+    public static final EmacsMuleEncoding INSTANCE = new EmacsMuleEncoding();
 }
diff --git a/src/org/joni/encoding/specific/GB18030Encoding.java b/src/org/joni/encoding/specific/GB18030Encoding.java
index 44086bc..0cfe1ea 100644
--- a/src/org/joni/encoding/specific/GB18030Encoding.java
+++ b/src/org/joni/encoding/specific/GB18030Encoding.java
@@ -24,7 +24,7 @@ import org.joni.IntHolder;
 import org.joni.encoding.MultiByteEncoding;
 import org.joni.exception.IllegalCharacterException;
 
-public final class GB18030Encoding extends MultiByteEncoding  {
+public final class GB18030Encoding extends MultiByteEncoding {
 
     protected GB18030Encoding() {
         super(1, 4, null, GB18030Trans, ASCIIEncoding.AsciiCtypeTable);
diff --git a/src/org/joni/encoding/specific/KOI8Encoding.java b/src/org/joni/encoding/specific/KOI8Encoding.java
index bd4dd1d..d4c5d5f 100644
--- a/src/org/joni/encoding/specific/KOI8Encoding.java
+++ b/src/org/joni/encoding/specific/KOI8Encoding.java
@@ -22,7 +22,7 @@ package org.joni.encoding.specific;
 import org.joni.IntHolder;
 import org.joni.encoding.CaseFoldMapEncoding;
 
-final public class KOI8Encoding extends CaseFoldMapEncoding  {
+final public class KOI8Encoding extends CaseFoldMapEncoding {
 
     protected KOI8Encoding() {
         super(KOI8_CtypeTable, KOI8_ToLowerCaseTable, KOI8_CaseFoldMap, false);
diff --git a/src/org/joni/encoding/specific/SJISEncoding.java b/src/org/joni/encoding/specific/SJISEncoding.java
index faca0cc..de45f2d 100644
--- a/src/org/joni/encoding/specific/SJISEncoding.java
+++ b/src/org/joni/encoding/specific/SJISEncoding.java
@@ -26,6 +26,7 @@ import org.joni.constants.CharacterType;
 import org.joni.encoding.CanBeTrailTableEncoding;
 import org.joni.exception.ErrorMessages;
 import org.joni.exception.InternalException;
+import org.joni.exception.ValueException;
 import org.joni.util.BytesHash;
 
 public final class SJISEncoding extends CanBeTrailTableEncoding {
@@ -60,7 +61,7 @@ public final class SJISEncoding extends CanBeTrailTableEncoding {
         } else if (code <= 0xffff) {
             return 2;
         } else {
-            throw new InternalException(ErrorMessages.ERR_INVALID_CODE_POINT_VALUE);            
+            throw new ValueException(ErrorMessages.ERR_INVALID_CODE_POINT_VALUE);            
         }
     }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/jruby-joni.git



More information about the pkg-java-commits mailing list