1 2 24 package org.enhydra.xml.io; 25 26 39 class ShiftJisCharacterSet extends CharacterSet { 40 41 public ShiftJisCharacterSet(String name, 42 int charSize, 43 String mimePreferred, 44 String [] aliases) { 45 super(name, charSize, mimePreferred, aliases); 46 } 47 48 51 public boolean isValid(char ch) { 52 int byte1 = ((ch >> 8) & 0xFF); 53 int byte2 = (ch & 0xFF); 54 55 60 if (((0xF0 <= byte1) && (byte1 <= 0xFC)) 61 && (((0x40 <= byte2) && (byte2 <= 0x7e)) 62 || ((0x80 <= byte2) && (byte2 <= 0xFC)))) { 63 return false; 65 } else { 66 return true; } 68 } 69 70 73 public boolean sameValidCharRange(CharacterSet otherSet) { 74 return (otherSet == this); 77 } 78 } 79 | Popular Tags |