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

Method checkEncoding

basex-core/src/main/java/org/basex/util/Strings.java:243–251  ·  view source on GitHub ↗

Checks if the specified encoding is supported. @param encoding encoding @return error message or null

(final String encoding)

Source from the content-addressed store, hash-verified

241 * @return error message or {@code null}
242 */
243 public static String checkEncoding(final String encoding) {
244 try {
245 if(Charset.isSupported(encoding)) return null;
246 } catch(final IllegalArgumentException ex) {
247 Util.debug(ex);
248 }
249 return "Unknown encoding: " + QueryError.similar(encoding,
250 Levenshtein.similar(Token.token(encoding), encodings())) + '.';
251 }
252
253 /**
254 * Capitalizes the first letter of a string.

Callers 4

OutputSerializerMethod · 0.95
versionDeclMethod · 0.95
toEncodingOrNullMethod · 0.95
execMethod · 0.95

Calls 6

debugMethod · 0.95
similarMethod · 0.95
similarMethod · 0.95
tokenMethod · 0.95
encodingsMethod · 0.95
isSupportedMethod · 0.45

Tested by

no test coverage detected