Skip to content

Commit

Permalink
Proper values for testing mbc codepoint length in EUC-JP.
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Mar 20, 2015
1 parent 208f44f commit ff2183b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/org/jcodings/specific/BaseEUCJPEncoding.java
Expand Up @@ -48,9 +48,11 @@ public int codeToMbcLength(int code) {
if ((code & 0xff0000) != 0) return 3;
if ((code & 0xff00) != 0) return 2;
} else {
if (code > 0xffffff) return 0;
if ((code & 0xff0000) >= 0x800000) return 3;
if ((code & 0xff00) >= 0x8000) return 2;
if (code > 0x00ffffff) {
throw new EncodingException(ErrorMessages.ERR_TOO_BIG_WIDE_CHAR_VALUE);
}
else if ((code & 0xff808080) == 0x00808080) return 3;
else if ((code & 0xffff8080) == 0x00008080) return 2;
}
throw new EncodingException(ErrorMessages.ERR_INVALID_CODE_POINT_VALUE);
}
Expand Down

0 comments on commit ff2183b

Please sign in to comment.