MCPcopy Create free account
hub / github.com/GateNLP/gate-core / getEncoding

Method getEncoding

src/main/java/gate/corpora/DocumentImpl.java:675–684  ·  view source on GitHub ↗

Get the encoding of the document content source

()

Source from the content-addressed store, hash-verified

673
674 /** Get the encoding of the document content source */
675 @Override
676 public String getEncoding() {
677 // we need to make sure we ALWAYS have an encoding
678 if(encoding == null || encoding.trim().length() == 0) {
679 // no encoding definded: use the platform default
680 encoding = java.nio.charset.Charset.forName(
681 System.getProperty("file.encoding")).name();
682 }
683 return encoding;
684 }
685
686 /** Set the encoding of the document content source */
687 @Optional

Callers 2

initMethod · 0.95
toXmlMethod · 0.95

Calls 3

nameMethod · 0.80
getPropertyMethod · 0.65
lengthMethod · 0.45

Tested by

no test coverage detected