Table of Contents

Class StringUtils

Namespace
ZXing.Common
Assembly
zxing.dll

Common string-related functions.

public static class StringUtils
Inheritance
StringUtils
Inherited Members

Fields

EUC_JP

EUC-JP

public const string EUC_JP = "EUC-JP"

Field Value

string

EUC_JP_ENCODING

ECU JP encoding if available

public static readonly Encoding EUC_JP_ENCODING

Field Value

Encoding

GB2312

GB2312

public const string GB2312 = "GB2312"

Field Value

string

GB2312_ENCODING

GB 2312 encoding if available

public static readonly Encoding GB2312_ENCODING

Field Value

Encoding

ISO88591

ISO-8859-1

public const string ISO88591 = "ISO-8859-1"

Field Value

string

ISO88591_ENCODING

ISO8859-1 encoding if available

public static readonly Encoding ISO88591_ENCODING

Field Value

Encoding

PLATFORM_DEFAULT_ENCODING

default encoding of the current platform (name)

public static readonly string PLATFORM_DEFAULT_ENCODING

Field Value

string

PLATFORM_DEFAULT_ENCODING_T

default encoding of the current platform (type)

public static readonly Encoding PLATFORM_DEFAULT_ENCODING_T

Field Value

Encoding

SHIFT_JIS

SJIS

public const string SHIFT_JIS = "SJIS"

Field Value

string

SHIFT_JIS_ENCODING

Shift JIS encoding if available

public static readonly Encoding SHIFT_JIS_ENCODING

Field Value

Encoding

UTF8

UTF-8

public const string UTF8 = "UTF-8"

Field Value

string

Methods

guessCharset(byte[], IDictionary<DecodeHintType, object>)

public static Encoding guessCharset(byte[] bytes, IDictionary<DecodeHintType, object> hints)

Parameters

bytes byte[]

bytes encoding a string, whose encoding should be guessed

hints IDictionary<DecodeHintType, object>

decode hints if applicable

Returns

Encoding

Charset of guessed encoding; at the moment will only guess one of: {@link #SHIFT_JIS_CHARSET}, {@link StandardCharsets#UTF_8}, {@link StandardCharsets#ISO_8859_1}, {@link StandardCharsets#UTF_16}, or the platform default encoding if none of these can possibly be correct

guessEncoding(byte[], IDictionary<DecodeHintType, object>)

Guesses the encoding.

public static string guessEncoding(byte[] bytes, IDictionary<DecodeHintType, object> hints)

Parameters

bytes byte[]

bytes encoding a string, whose encoding should be guessed

hints IDictionary<DecodeHintType, object>

decode hints if applicable

Returns

string