Package org.postgresql.core
Class EncodingPredictor
- java.lang.Object
-
- org.postgresql.core.EncodingPredictor
-
public class EncodingPredictor extends java.lang.Object
Predicts encoding for error messages based on some heuristics.- For certain languages, it is known how "FATAL" is translated
- For Japanese, several common words are hardcoded
- Then try various LATIN encodings
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
EncodingPredictor.DecodeResult
In certain cases the encoding is not known for sure (e.g.(package private) static class
EncodingPredictor.Translation
-
Field Summary
Fields Modifier and Type Field Description private static EncodingPredictor.Translation[]
FATAL_TRANSLATIONS
-
Constructor Summary
Constructors Constructor Description EncodingPredictor()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static boolean
arrayContains(byte[] first, int firstOffset, int firstLength, byte[] second, int secondOffset, int secondLength)
static EncodingPredictor.DecodeResult
decode(byte[] bytes, int offset, int length)
-
-
-
Field Detail
-
FATAL_TRANSLATIONS
private static final EncodingPredictor.Translation[] FATAL_TRANSLATIONS
-
-
Method Detail
-
decode
public static EncodingPredictor.DecodeResult decode(byte[] bytes, int offset, int length)
-
arrayContains
private static boolean arrayContains(byte[] first, int firstOffset, int firstLength, byte[] second, int secondOffset, int secondLength)
-
-