com.yahoo.text.Utf8.getCharset()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(1.3k)|赞(0)|评价(0)|浏览(146)

本文整理了Java中com.yahoo.text.Utf8.getCharset()方法的一些代码示例,展示了Utf8.getCharset()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utf8.getCharset()方法的具体详情如下:
包路径:com.yahoo.text.Utf8
类名称:Utf8
方法名:getCharset

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";

相关文章