public final class StringUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
GB2312 |
static Charset |
GB2312_CHARSET |
static String |
SHIFT_JIS |
static Charset |
SHIFT_JIS_CHARSET |
Modifier and Type | Method and Description |
---|---|
static Charset |
guessCharset(byte[] bytes,
Map<DecodeHintType,?> hints) |
static String |
guessEncoding(byte[] bytes,
Map<DecodeHintType,?> hints) |
public static final Charset SHIFT_JIS_CHARSET
public static final Charset GB2312_CHARSET
public static final String SHIFT_JIS
public static final String GB2312
public static String guessEncoding(byte[] bytes, Map<DecodeHintType,?> hints)
bytes
- bytes encoding a string, whose encoding should be guessedhints
- decode hints if applicablepublic static Charset guessCharset(byte[] bytes, Map<DecodeHintType,?> hints)
bytes
- bytes encoding a string, whose encoding should be guessedhints
- decode hints if applicableSHIFT_JIS_CHARSET
, StandardCharsets.UTF_8
,
StandardCharsets.ISO_8859_1
, StandardCharsets.UTF_16
,
or the platform default encoding if
none of these can possibly be correctCopyright © 2007–2022. All rights reserved.