Package com.google.zxing.common
Class StringUtils
java.lang.Object
com.google.zxing.common.StringUtils
Common string-related functions.
- Author:
- Sean Owen, Alex Dupre
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic CharsetguessCharset(byte[] bytes, Map<DecodeHintType, ?> hints) static StringguessEncoding(byte[] bytes, Map<DecodeHintType, ?> hints)
-
Field Details
-
SHIFT_JIS_CHARSET
-
GB2312_CHARSET
-
SHIFT_JIS
- See Also:
-
GB2312
- See Also:
-
-
Method Details
-
guessEncoding
- Parameters:
bytes- bytes encoding a string, whose encoding should be guessedhints- decode hints if applicable- Returns:
- name of guessed encoding; at the moment will only guess one of: "SJIS", "UTF8", "ISO8859_1", or the platform default encoding if none of these can possibly be correct
-
guessCharset
- Parameters:
bytes- bytes encoding a string, whose encoding should be guessedhints- decode hints if applicable- Returns:
- Charset of guessed encoding; at the moment will only guess one of:
SHIFT_JIS_CHARSET,StandardCharsets.UTF_8,StandardCharsets.ISO_8859_1,StandardCharsets.UTF_16, or the platform default encoding if none of these can possibly be correct
-