TINMAN 3D / REALTIME TERRAIN
Software Development Kit - User Manual

class CharacterEncodingSimple in Tinman.Core.Formatting

A character encoding that maps Unicode characters to 8-bit codes.

abstract class CharacterEncodingSimple extends CharacterEncoding

Public / Attributes

ASCII

Character encoding US-ASCII (7-bit).

public static readonly field ASCII
type CharacterEncodingSimple

BytesPerCharacter

Returns the number of bytes per character.

public override sealed property BytesPerCharacter { get }
type int32
value [>=0] The number of bytes per character or 0 if this encoding uses variable byte counts (e.g. UTF-8).
implements CharacterEncoding.BytesPerCharacter

Cp437

Character encoding CP437 (8-bit).

public static readonly field Cp437
type CharacterEncodingSimple

Remarks:

This is the character set of the famous VGA BIOS font, featuring the legendary box drawing characters.

ISO_8859_1

Character encoding ISO-8859-1 (8-bit).

public static readonly field ISO_8859_1
type CharacterEncodingSimple

Name

Returns the name of this character encoding.

public abstract property Name { get }
type string
value [not-null] The encoding name.
inherited CharacterEncoding.Name

Public / Methods

Decode

Decodes a single unicode character.

public abstract method Decode (ByteBuffer input)
type int32
params input [not-null] The input buffer.
returns The decoded unicode character or -1 if the given buffer does not contain any more characters.
inherited CharacterEncoding.Decode

Decodes a single unicode character.

public abstract method Decode (IDataStream input)
type int32
params input [not-null] The input buffer.
returns The decoded unicode character or -1 if the given buffer does not contain any more characters.
inherited CharacterEncoding.Decode

DecodeCharacter

Decodes a single unicode character.

public abstract method DecodeCharacter (int32 code)
type char
params code The simple 8-bit code.
returns The unicode character.

DecodeString

Converts the given encoded string to unicode.

public method DecodeString (ByteBuffer bytes)
type string
params bytes The single-byte encoded string.
returns The unicode string or null iff bytes is null.
inherited CharacterEncoding.DecodeString

Encode

Encodes the given unicode character.

public abstract method Encode (char character, ByteBuffer output)
type int32
params character The unicode character.
  output [not-null] The output buffer.
returns The number of bytes that have been written to output if there was enough space left; -n if the buffer does not have enough space left, where n is then the number of bytes that would have been written.
inherited CharacterEncoding.Encode

Remarks:

Characters that cannot be encoded will be replaced with '?'.


Encodes the given unicode character.

public abstract method Encode (char character, IDataStream output)
type int32
params character The unicode character.
  output [not-null] The output buffer.
returns The number of bytes that have been written to output.
inherited CharacterEncoding.Encode

Remarks:

Characters that cannot be encoded will be replaced with '?'.

EncodeCharacter

Encodes the given unicode character.

public abstract method EncodeCharacter (char character)
type int32
params character The character to encode.
returns [0..255] The simple 8-bit code.

Remarks:

Characters that cannot be encoded will be replaced with '?'.

EncodeCount

Encodes the given unicode character.

public abstract method EncodeCount (char character)
type int32
params character The unicode character.
returns The number of bytes that would have been written to an output buffer.
inherited CharacterEncoding.EncodeCount

Remarks:

Characters that cannot be encoded will be replaced with '?'.

EncodeString

Converts the given unicode string to this encoding.

[OwnerReturn]
public method EncodeString (string str, [Owner] ByteBuffer bytes = null)
type ByteBuffer
params str The unicode string.
  bytes The output buffer (can be null). Defaults to null.
returns The resulting buffer or null iff str is null.
inherited CharacterEncoding.EncodeString

Remarks:

The encoded bytes will be written to bytes beginning at the current buffer position. Before returning, this method sets the Position and Limit to the range of encoded bytes that have been output.

GetByteCount

Returns the number of encoded bytes for the given string.

public method GetByteCount (char[] str)
type int32
params str [not-null] The string.
returns [>=0] The number of encoded bytes.
inherited CharacterEncoding.GetByteCount

Returns the number of encoded bytes for the given string.

public method GetByteCount (string str)
type int32
params str [not-null] The string.
returns [>=0] The number of encoded bytes.
inherited CharacterEncoding.GetByteCount

Returns the number of encoded bytes for the given string.

public method GetByteCount ([] char[] str, int32 offset, int32 count)
type int32
params str [not-null] The string.
  offset [>=0] Offset to first character in string.
  count [>=0] Number of characters in string.
returns [>=0] The number of encoded bytes.
inherited CharacterEncoding.GetByteCount

Returns the number of encoded bytes for the given string.

public method GetByteCount (string str, int32 offset, int32 count)
type int32
params str [not-null] The string.
  offset [>=0] Offset to first character in string.
  count [>=0] Number of characters in string.
returns [>=0] The number of encoded bytes.
inherited CharacterEncoding.GetByteCount