Top Fields Constructors Methods
org.jcodings.specific

pack-priv abstract Class BaseUTF8Encoding

extends UnicodeEncoding
Class Inheritance
Known Direct Subclasses
org.jcodings.specific.NonStrictUTF8Encoding, org.jcodings.specific.UTF8Encoding
Imports
org.jcodings.Config, .IntHolder, org.jcodings.ascii.AsciiTables, org.jcodings.exception.ErrorCodes, org.jcodings.unicode.UnicodeEncoding

Field Summary

Modifier and TypeField and Description
private static final int
private static final int
pack-priv static final boolean
private static final int

Constructor Summary

AccessConstructor and Description
protected
BaseUTF8Encoding(int[] EncLen, int[][] Trans)

Method Summary

Modifier and TypeMethod and Description
public int
codeToMbc(int code, byte[] bytes, int p)

Implements abstract org.jcodings.Encoding.codeToMbc.

Extracts code point into it's multibyte representation
public int
codeToMbcLength(int code)

Implements abstract org.jcodings.Encoding.codeToMbcLength.

Returns character length given a code point Oniguruma equivalent: code_to_mbclen
public int[]
ctypeCodeRange(int ctype, IntHolder sbOut)

Implements abstract org.jcodings.Encoding.ctypeCodeRange.

utf8_get_ctype_code_range
public String
getCharsetName()

Overrides org.jcodings.unicode.UnicodeEncoding.getCharsetName.

The name of the equivalent Java Charset for this encoding.
public boolean
isNewLine(byte[] bytes, int p, int end)

Overrides org.jcodings.AbstractEncoding.isNewLine.

onigenc_is_mbc_newline_0x0a / used also by multibyte encodings
public boolean
isReverseMatchAllowed(byte[] bytes, int p, int end)

Implements abstract org.jcodings.Encoding.isReverseMatchAllowed.

onigenc_always_true_is_allowed_reverse_match
public int
leftAdjustCharHead(byte[]
byte stream
bytes
,
int
position
p
,
int
stop
s
,
int
end
end
)

Implements abstract org.jcodings.Encoding.leftAdjustCharHead.

utf8_left_adjust_char_head
public int
mbcCaseFold(int
case fold flag
flag
,
byte[] bytes, IntHolder
an IntHolder that points at character head
pp
,
int end, byte[]
a buffer where to extract case folded character Oniguruma equivalent: mbc_case_fold
fold
)

Overrides org.jcodings.unicode.UnicodeEncoding.mbcCaseFold.

onigenc_ascii_mbc_case_fold
public int
mbcToCode(byte[] bytes, int p, int end)

Implements abstract org.jcodings.Encoding.mbcToCode.

Returns code point for a character Oniguruma equivalent: mbc_to_code
pack-priv static byte
trail0(int code)

pack-priv static byte
trailS(int code, int shift)

private static boolean
utf8IsLead(int c)

Inherited from org.jcodings.unicode.UnicodeEncoding:
applyAllCaseFoldcaseFoldCodesByStringcaseMapctypeCodeRangeisCodeCTypeisInCodeRangepropertyNameToCType

Field Detail

INVALID_CODE_FEback to summary
private static final int INVALID_CODE_FE
INVALID_CODE_FFback to summary
private static final int INVALID_CODE_FF
USE_INVALID_CODE_SCHEMEback to summary
pack-priv static final boolean USE_INVALID_CODE_SCHEME
VALID_CODE_LIMITback to summary
private static final int VALID_CODE_LIMIT

Constructor Detail

BaseUTF8Encodingback to summary
protected BaseUTF8Encoding(int[] EncLen, int[][] Trans)

Method Detail

codeToMbcback to summary
public int codeToMbc(int code, byte[] bytes, int p)

Implements abstract org.jcodings.Encoding.codeToMbc.

Doc from org.jcodings.Encoding.codeToMbc.

Extracts code point into it's multibyte representation

Returns:int

character length for the given code point Oniguruma equivalent: code_to_mbc

Annotations
@Override
codeToMbcLengthback to summary
public int codeToMbcLength(int code)

Implements abstract org.jcodings.Encoding.codeToMbcLength.

Doc from org.jcodings.Encoding.codeToMbcLength.

Returns character length given a code point Oniguruma equivalent: code_to_mbclen

Annotations
@Override
ctypeCodeRangeback to summary
public int[] ctypeCodeRange(int ctype, IntHolder sbOut)

Implements abstract org.jcodings.Encoding.ctypeCodeRange.

utf8_get_ctype_code_range

Annotations
@Override
getCharsetNameback to summary
public String getCharsetName()

Overrides org.jcodings.unicode.UnicodeEncoding.getCharsetName.

Doc from org.jcodings.Encoding.getCharsetName.

The name of the equivalent Java Charset for this encoding. Defaults to the name of the encoding. Subclasses can override this to provide a different name.

Returns:String

the name of the equivalent Java Charset for this encoding

Annotations
@Override
isNewLineback to summary
public boolean isNewLine(byte[] bytes, int p, int end)

Overrides org.jcodings.AbstractEncoding.isNewLine.

Doc from org.jcodings.AbstractEncoding.isNewLine.

onigenc_is_mbc_newline_0x0a / used also by multibyte encodings

Annotations
@Override
isReverseMatchAllowedback to summary
public boolean isReverseMatchAllowed(byte[] bytes, int p, int end)

Implements abstract org.jcodings.Encoding.isReverseMatchAllowed.

onigenc_always_true_is_allowed_reverse_match

Annotations
@Override
leftAdjustCharHeadback to summary
public int leftAdjustCharHead(byte[] bytes, int p, int s, int end)

Implements abstract org.jcodings.Encoding.leftAdjustCharHead.

utf8_left_adjust_char_head

Parameters
bytes:byte[]

Doc from org.jcodings.Encoding.leftAdjustCharHead.

byte stream

p:int

Doc from org.jcodings.Encoding.leftAdjustCharHead.

position

s:int

Doc from org.jcodings.Encoding.leftAdjustCharHead.

stop

end:int

Doc from org.jcodings.Encoding.leftAdjustCharHead.

end

Annotations
@Override
mbcCaseFoldback to summary
public int mbcCaseFold(int flag, byte[] bytes, IntHolder pp, int end, byte[] fold)

Overrides org.jcodings.unicode.UnicodeEncoding.mbcCaseFold.

Doc from org.jcodings.AbstractEncoding.mbcCaseFold.

onigenc_ascii_mbc_case_fold

Parameters
flag:int

Doc from org.jcodings.Encoding.mbcCaseFold.

case fold flag

pp:IntHolder

Doc from org.jcodings.Encoding.mbcCaseFold.

an IntHolder that points at character head

fold:byte[]

Doc from org.jcodings.Encoding.mbcCaseFold.

a buffer where to extract case folded character Oniguruma equivalent: mbc_case_fold

Annotations
@Override
mbcToCodeback to summary
public int mbcToCode(byte[] bytes, int p, int end)

Implements abstract org.jcodings.Encoding.mbcToCode.

Doc from org.jcodings.Encoding.mbcToCode.

Returns code point for a character Oniguruma equivalent: mbc_to_code

Annotations
@Override
trail0back to summary
pack-priv static byte trail0(int code)
trailSback to summary
pack-priv static byte trailS(int code, int shift)
utf8IsLeadback to summary
private static boolean utf8IsLead(int c)