本文整理了Java中com.yahoo.text.Utf8.getCharset()
方法的一些代码示例,展示了Utf8.getCharset()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utf8.getCharset()
方法的具体详情如下:
包路径:com.yahoo.text.Utf8
类名称:Utf8
方法名:getCharset
[英]Returns the Charset instance for UTF-8
[中]返回UTF-8的字符集实例
代码示例来源:origin: com.yahoo.vespa/application
static Charset charset(String contentType) {
if (contentType != null) {
Matcher matcher = charsetPattern.matcher(contentType);
if (matcher.find()) {
try {
return Charset.forName(matcher.group(1));
} catch (UnsupportedCharsetException uce) {
return Utf8.getCharset();
}
}
}
return Utf8.getCharset();
}
代码示例来源:origin: com.yahoo.vespa/linguistics
@Override
public Detection detect(String input, Hint hint) {
return new Detection(guessLanguage(input), Utf8.getCharset().name(), false);
}
代码示例来源:origin: com.yahoo.vespa/linguistics
@Override
public Detection detect(String input, Hint hint) {
return new Detection(guessLanguage(input), Utf8.getCharset().name(), false);
}
代码示例来源:origin: com.yahoo.vespa/config-application-package
if (!path.exists()) return;
if (fullPathNames) {
digest.update(path.getPath().getBytes(Utf8.getCharset()));
} else {
digest.update(path.getName().getBytes(Utf8.getCharset()));
代码示例来源:origin: com.yahoo.vespa/linguistics
return Utf8.getCharset().name();
} else if (!hasHighs) {
return "US-ASCII";
内容来源于网络,如有侵权,请联系作者删除!