MCPcopy Create free account
hub / github.com/apache/calcite / getCharset

Method getCharset

core/src/main/java/org/apache/calcite/sql/SqlUtil.java:1046–1055  ·  view source on GitHub ↗

Returns the Java-level Charset based on given SQL-level name. @param charsetName Sql charset name, must not be null. @return charset, or default charset if charsetName is null. @throws UnsupportedCharsetException If no support for the named charset is available in this instance of the J

(String charsetName)

Source from the content-addressed store, hash-verified

1044 * is available in this instance of the Java virtual machine
1045 */
1046 public static Charset getCharset(String charsetName) {
1047 String javaCharsetName =
1048 translateCharacterSetName(
1049 requireNonNull(charsetName, "charsetName")
1050 .toUpperCase(Locale.ROOT));
1051 if (javaCharsetName == null) {
1052 throw new UnsupportedCharsetException(charsetName);
1053 }
1054 return Charset.forName(javaCharsetName);
1055 }
1056
1057 /**
1058 * Validate if value can be decoded by given charset.

Callers 15

SqlCollationMethod · 0.95
validateCallMethod · 0.95
inferReturnTypeMethod · 0.95
deriveTypeMethod · 0.95
validateCallMethod · 0.95
inferReturnTypeMethod · 0.95
deriveTypeMethod · 0.95
validateCallMethod · 0.95
inferReturnTypeMethod · 0.95
deriveTypeMethod · 0.95
parseCollationMethod · 0.95
convertWithCharsetMethod · 0.95

Calls 1

Tested by

no test coverage detected