MCPcopy Create free account
hub / github.com/BaseXdb/basex / encoding

Method encoding

basex-core/src/main/java/org/basex/io/in/TextInput.java:120–128  ·  view source on GitHub ↗

Sets a new encoding. @param encoding encoding (ignored if null or an empty string) @return self reference @throws IOException I/O Exception

(final String encoding)

Source from the content-addressed store, hash-verified

118 * @throws IOException I/O Exception
119 */
120 public TextInput encoding(final String encoding) throws IOException {
121 if(encoding != null && !encoding.isEmpty()) {
122 final String enc = normEncoding(encoding, false);
123 decoder = TextDecoder.get(enc != UTF16 ? enc :
124 decoder.encoding.equals(UTF16LE) ? UTF16LE : UTF16BE);
125 decoder.fallback = fallback;
126 }
127 return this;
128 }
129
130 /**
131 * Returns the encoding.

Callers

nothing calls this directly

Calls 4

getMethod · 0.95
normEncodingMethod · 0.80
isEmptyMethod · 0.45
equalsMethod · 0.45

Tested by

no test coverage detected