net.kano.joscar
Class ImEncodingParams

java.lang.Object
  extended bynet.kano.joscar.ImEncodingParams

public final class ImEncodingParams
extends java.lang.Object

Represents a set of IM encoding parameters that define the way an IM-encoded string is encoded and decoded.

See Also:
ImEncodedString

Field Summary
static int CHARSET_ASCII
          A charset code indicating US-ASCII encoding.
static int CHARSET_ISO
          A charset code indicating ISO-8859-1 encoding.
static int CHARSET_UTF16
          A charset code indicating UCS-2BE, or UTF-16BE.
static int CHARSUBSET_DEFAULT
          A charset "subcode" that is sent by default.
 
Constructor Summary
ImEncodingParams(int charsetCode)
          Creates a new IM encoding parameters object with the given charset code and a "charsubset" code of CHARSUBSET_DEFAULT.
ImEncodingParams(int charsetCode, int charsetSubcode)
          Creates a new IM encoding parameters object with the given charset and "charsubset" codes.
 
Method Summary
 int getCharsetCode()
          Returns the charset code contained in this object.
 int getCharsetSubcode()
          Returns the charset "subcode" contained in this object.
 java.lang.String toCharsetName()
          Attempts to produce the name of a charset (like "US-ASCII") from this set of encoding parameters.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CHARSET_ASCII

public static final int CHARSET_ASCII
A charset code indicating US-ASCII encoding.

See Also:
Constant Field Values

CHARSET_ISO

public static final int CHARSET_ISO
A charset code indicating ISO-8859-1 encoding.

See Also:
Constant Field Values

CHARSET_UTF16

public static final int CHARSET_UTF16
A charset code indicating UCS-2BE, or UTF-16BE.

See Also:
Constant Field Values

CHARSUBSET_DEFAULT

public static final int CHARSUBSET_DEFAULT
A charset "subcode" that is sent by default.

See Also:
Constant Field Values
Constructor Detail

ImEncodingParams

public ImEncodingParams(int charsetCode)
Creates a new IM encoding parameters object with the given charset code and a "charsubset" code of CHARSUBSET_DEFAULT.

Parameters:
charsetCode - a charset code, like CHARSET_ASCII

ImEncodingParams

public ImEncodingParams(int charsetCode,
                        int charsetSubcode)
Creates a new IM encoding parameters object with the given charset and "charsubset" codes.

Parameters:
charsetCode - a charset code, like CHARSET_ASCII
charsetSubcode - a charset "subcode," like CHARSUBSET_DEFAULT
Method Detail

getCharsetCode

public final int getCharsetCode()
Returns the charset code contained in this object. Normally one of CHARSET_ASCII, CHARSET_ISO, and CHARSET_UTF16.

Returns:
the charset code parameter contained in this parameter set

getCharsetSubcode

public final int getCharsetSubcode()
Returns the charset "subcode" contained in this object. Normally CHARSUBSET_DEFAULT.

Returns:
the "charsubset" contained in this object

toCharsetName

public final java.lang.String toCharsetName()
Attempts to produce the name of a charset (like "US-ASCII") from this set of encoding parameters. Returns null if this object represents an unknown charset.

Returns:
the name of the charset described by these parameters, or null if unknown

toString

public java.lang.String toString()