We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 208f44f commit ff2183bCopy full SHA for ff2183b
src/org/jcodings/specific/BaseEUCJPEncoding.java
@@ -48,9 +48,11 @@ public int codeToMbcLength(int code) {
48
if ((code & 0xff0000) != 0) return 3;
49
if ((code & 0xff00) != 0) return 2;
50
} else {
51
- if (code > 0xffffff) return 0;
52
- if ((code & 0xff0000) >= 0x800000) return 3;
53
- if ((code & 0xff00) >= 0x8000) return 2;
+ if (code > 0x00ffffff) {
+ throw new EncodingException(ErrorMessages.ERR_TOO_BIG_WIDE_CHAR_VALUE);
+ }
54
+ else if ((code & 0xff808080) == 0x00808080) return 3;
55
+ else if ((code & 0xffff8080) == 0x00008080) return 2;
56
}
57
throw new EncodingException(ErrorMessages.ERR_INVALID_CODE_POINT_VALUE);
58
0 commit comments