org.enhydra.xml.io
Class ShiftJisCharacterSet

java.lang.Object
  |
  +--org.enhydra.xml.io.CharacterSet
        |
        +--org.enhydra.xml.io.ShiftJisCharacterSet

class ShiftJisCharacterSet
extends CharacterSet

Class that implements special character handling for Shift_JIS. This detects invalid ranges so that they can be encoded by character entity references.

Required to support i-mode Emoji characters. These are character codes that represent symbols on i-mode phones. The characters codes are invalid Shift-JIS character and must be encoded in HTML pages as numeric character entity references. Special handling is required on formatting to detect these characters.

See http://www.nttdocomo.com/i/tag/emoji/ for details.


Constructor Summary
ShiftJisCharacterSet(java.lang.String name, int charSize, java.lang.String mimePreferred, java.lang.String[] aliases)
          Constructor
 
Method Summary
 java.lang.String[] getAliases()
          Get the aliases
 int getCharSize()
          Get the character size, in bits
 int getMaxCharValue()
          Get the maximum value for a character
 java.lang.String getMIMEPreferred()
          Get the MIME preferred name or null if unspecified
 java.lang.String getName()
          Get the name
 boolean isCompatible(CharacterSet otherSet)
          Determine if another character set is compatible to this character set.
 boolean isValid(char ch)
          Determine if a unicode character has a valid mapping to this character set.
 boolean sameValidCharRange(CharacterSet otherSet)
          Determine if another character set has the same valid range of character codes as this character set.
 java.lang.String toString()
          Get string representation of object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ShiftJisCharacterSet

public ShiftJisCharacterSet(java.lang.String name,
                            int charSize,
                            java.lang.String mimePreferred,
                            java.lang.String[] aliases)
Constructor

Method Detail

isValid

public boolean isValid(char ch)
Description copied from class: CharacterSet
Determine if a unicode character has a valid mapping to this character set.

WARNING: This is only well implemented for a few character sets on an as-needed basis; the rest just go by the character size.

Overrides:
isValid in class CharacterSet
See Also:
CharacterSet.isValid

sameValidCharRange

public boolean sameValidCharRange(CharacterSet otherSet)
Description copied from class: CharacterSet
Determine if another character set has the same valid range of character codes as this character set. That is, will isValid() return the same value for any arbitrary unicode character.

WARNING: This is only well implemented for a few character sets on an as-needed basis; the rest just go by the character size.

Overrides:
sameValidCharRange in class CharacterSet
See Also:
CharacterSet.sameValidCharRange

getName

public final java.lang.String getName()
Get the name


getCharSize

public final int getCharSize()
Get the character size, in bits


getMaxCharValue

public final int getMaxCharValue()
Get the maximum value for a character


getMIMEPreferred

public final java.lang.String getMIMEPreferred()
Get the MIME preferred name or null if unspecified


getAliases

public final java.lang.String[] getAliases()
Get the aliases


isCompatible

public boolean isCompatible(CharacterSet otherSet)
Determine if another character set is compatible to this character set. "Compatible" means that for every character where otherSet.isValid() return true, this.isValid() will return true as well.

WARNING: This is only well implemented for a few character sets on an as-needed basis; the rest just go by the character set size.


toString

public java.lang.String toString()
Get string representation of object

Overrides:
toString in class java.lang.Object


Copyright © 1999-2002 enhydra.org (Mark Diekhans, David Li, Richard Kunze). All Rights reserved.