org.apache.tomcat.util.buf.B2CConverter.getCharset()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(6.4k)|赞(0)|评价(0)|浏览(117)

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

B2CConverter.getCharset介绍

[英]Obtain the Charset for the given encoding
[中]获取给定编码的字符集

代码示例

代码示例来源:origin: codefollower/Tomcat-Research

private Charset getCharset(String encoding) {
  if (encoding == null) {
    return DEFAULT_CHARSET;
  }
  try {
    return B2CConverter.getCharset(encoding);
  } catch (UnsupportedEncodingException e) {
    return DEFAULT_CHARSET;
  }
}

代码示例来源:origin: org.apache.geronimo.ext.tomcat/util

private Charset getCharset(String encoding) {
  if (encoding == null) {
    return DEFAULT_CHARSET;
  }
  try {
    return B2CConverter.getCharset(encoding);
  } catch (UnsupportedEncodingException e) {
    return DEFAULT_CHARSET;
  }
}

代码示例来源:origin: org.apache.coyote/com.springsource.org.apache.coyote

private Charset getCharset(String encoding) {
  if (encoding == null) {
    return DEFAULT_CHARSET;
  }
  try {
    return B2CConverter.getCharset(encoding);
  } catch (UnsupportedEncodingException e) {
    return DEFAULT_CHARSET;
  }
}

代码示例来源:origin: org.apache.tomcat/tomcat-util-scan

public void setRequestCharacterEncoding(String requestCharacterEncoding) {
  if (requestCharacterEncoding != null) {
    try {
      B2CConverter.getCharset(requestCharacterEncoding);
    } catch (UnsupportedEncodingException e) {
      throw new IllegalArgumentException(e);
    }
  }
  this.requestCharacterEncoding = requestCharacterEncoding;
}

代码示例来源:origin: org.apache.tomcat/tomcat-util-scan

public void setResponseCharacterEncoding(String responseCharacterEncoding) {
  if (responseCharacterEncoding != null) {
    try {
      B2CConverter.getCharset(responseCharacterEncoding);
    } catch (UnsupportedEncodingException e) {
      throw new IllegalArgumentException(e);
    }
  }
  this.responseCharacterEncoding = responseCharacterEncoding;
}

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

public void setResponseCharacterEncoding(String responseCharacterEncoding) {
  if (responseCharacterEncoding != null) {
    try {
      B2CConverter.getCharset(responseCharacterEncoding);
    } catch (UnsupportedEncodingException e) {
      throw new IllegalArgumentException(e);
    }
  }
  this.responseCharacterEncoding = responseCharacterEncoding;
}

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

public void setRequestCharacterEncoding(String requestCharacterEncoding) {
  if (requestCharacterEncoding != null) {
    try {
      B2CConverter.getCharset(requestCharacterEncoding);
    } catch (UnsupportedEncodingException e) {
      throw new IllegalArgumentException(e);
    }
  }
  this.requestCharacterEncoding = requestCharacterEncoding;
}

代码示例来源:origin: codefollower/Tomcat-Research

public C2BConverter(String encoding) throws IOException {
  encoder = B2CConverter.getCharset(encoding).newEncoder();
  // FIXME: See if unmappable/malformed behavior configuration is needed
  //        in practice
  encoder.onUnmappableCharacter(CodingErrorAction.REPLACE)
    .onMalformedInput(CodingErrorAction.REPLACE);
  char[] left = new char[4];
  leftovers = CharBuffer.wrap(left);
}

代码示例来源:origin: org.apache.geronimo.ext.tomcat/util

public C2BConverter(String encoding) throws IOException {
  encoder = B2CConverter.getCharset(encoding).newEncoder();
  // FIXME: See if unmappable/malformed behavior configuration is needed
  //        in practice
  encoder.onUnmappableCharacter(CodingErrorAction.REPLACE)
    .onMalformedInput(CodingErrorAction.REPLACE);
  char[] left = new char[4];
  leftovers = CharBuffer.wrap(left);
}

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

private Charset getDigestCharset() throws UnsupportedEncodingException {
  String charset = getDigestEncoding();
  if (charset == null) {
    return StandardCharsets.ISO_8859_1;
  } else {
    return B2CConverter.getCharset(charset);
  }
}

代码示例来源:origin: org.apache.tomcat/tomcat-catalina

private Charset getDigestCharset() throws UnsupportedEncodingException {
  String charset = getDigestEncoding();
  if (charset == null) {
    return StandardCharsets.ISO_8859_1;
  } else {
    return B2CConverter.getCharset(charset);
  }
}

代码示例来源:origin: codefollower/Tomcat-Research

protected Charset getDigestCharset() throws UnsupportedEncodingException {
  if (digestEncoding == null) {
    return StandardCharsets.ISO_8859_1;
  } else {
    return B2CConverter.getCharset(getDigestEncoding());
  }
}

代码示例来源:origin: org.apache.geronimo.ext.tomcat/catalina

protected Charset getDigestCharset() throws UnsupportedEncodingException {
  if (digestEncoding == null) {
    return Charset.defaultCharset();
  } else {
    return B2CConverter.getCharset(getDigestEncoding());
  }
}

代码示例来源:origin: org.apache.catalina/com.springsource.org.apache.catalina

protected Charset getDigestCharset() throws UnsupportedEncodingException {
  if (digestEncoding == null) {
    return Charset.defaultCharset();
  } else {
    return B2CConverter.getCharset(getDigestEncoding());
  }
}

代码示例来源:origin: org.apache.tomcat/tomcat-catalina

public void setEncoding(String encodingName) {
  if (encodingName == null) {
    encoding = StandardCharsets.UTF_8;
  } else {
    try {
      this.encoding = B2CConverter.getCharset(encodingName);
    } catch (UnsupportedEncodingException e) {
      log.warn(sm.getString("mdCredentialHandler.unknownEncoding",
          encodingName, encoding.name()));
    }
  }
}

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

public void setEncoding(String encodingName) {
  if (encodingName == null) {
    encoding = StandardCharsets.UTF_8;
  } else {
    try {
      this.encoding = B2CConverter.getCharset(encodingName);
    } catch (UnsupportedEncodingException e) {
      log.warn(sm.getString("mdCredentialHandler.unknownEncoding",
          encodingName, encoding.name()));
    }
  }
}

代码示例来源:origin: org.apache.tomcat/tomcat-catalina

/**
 * Set the URI encoding to be used for the URI.
 *
 * @param URIEncoding The new URI character encoding.
 */
public void setURIEncoding(String URIEncoding) {
  try {
    uriCharset = B2CConverter.getCharset(URIEncoding);
  } catch (UnsupportedEncodingException e) {
    log.warn(sm.getString("coyoteConnector.invalidEncoding",
        URIEncoding, uriCharset.name()), e);
  }
}

代码示例来源:origin: org.apache.coyote/com.springsource.org.apache.coyote

private void init() throws IOException {
  ios = new IntermediateOutputStream(bb);
  conv = new WriteConvertor(ios, B2CConverter.getCharset(encoding));
  writer = new BufferedWriter(conv);
}

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

/**
 * Set the URI encoding to be used for the URI.
 *
 * @param URIEncoding The new URI character encoding.
 */
public void setURIEncoding(String URIEncoding) {
  try {
    uriCharset = B2CConverter.getCharset(URIEncoding);
  } catch (UnsupportedEncodingException e) {
    log.warn(sm.getString("coyoteConnector.invalidEncoding",
        URIEncoding, uriCharset.name()), e);
  }
}

代码示例来源:origin: org.apache.coyote/com.springsource.org.apache.coyote

public void reset()
  throws IOException
{
  // destroy the reader/iis
  iis=new IntermediateInputStream();
  conv = new ReadConvertor(iis, getCharset(encoding));
}

相关文章

微信公众号

最新文章

更多