import java.nio.charset.Charset; //导入方法依赖的package包/类

/**

* Constructs MysqlCharset object

*

* @param charsetName

* MySQL charset name

* @param mblen

* Max number of bytes per character

* @param priority

* MysqlCharset with highest lever of this param will be used for Java encoding --> Mysql charsets conversion.

* @param javaEncodings

* List of Java encodings corresponding to this MySQL charset; the first name in list is the default for mysql --> java data conversion

*/

public MysqlCharset(String charsetName, int mblen, int priority, String[] javaEncodings) {

this.charsetName = charsetName;

this.mblen = mblen;

this.priority = priority;

for (int i = 0; i < javaEncodings.length; i++) {

String encoding = javaEncodings[i];

try {

Charset cs = Charset.forName(encoding);

addEncodingMapping(cs.name());

Set als = cs.aliases();

Iterator ali = als.iterator();

while (ali.hasNext()) {

addEncodingMapping(ali.next());

}

} catch (Exception e) {

// if there is no support of this charset in JVM it's still possible to use our converter for 1-byte charsets

if (mblen == 1) {

addEncodingMapping(encoding);

}

}

}

if (this.javaEncodingsUc.size() == 0) {

if (mblen > 1) {

addEncodingMapping("UTF-8");

} else {

addEncodingMapping("Cp1252");

}

}

}

java中aliases的意思,Java Charset.aliases方法代码示例相关推荐

  1. java中treenode的使用_Java TreeNode.isLeaf方法代码示例

    import javax.swing.tree.TreeNode; //导入方法依赖的package包/类 public static boolean findString(ProfilerTable ...

  2. java kryo register_java相关:Kryo框架使用方法代码示例

    java相关:Kryo框架使用方法代码示例 发布于 2021-1-21| 复制链接 摘记: Kryo框架的source已移至https://github.com/EsotericSoftware/kr ...

  3. python中stringvar的用法_Python tkinter.StringVar方法代码示例

    本文整理汇总了Python中tkinter.StringVar方法的典型用法代码示例.如果您正苦于以下问题:Python tkinter.StringVar方法的具体用法?Python tkinter ...

  4. python中formatter的用法_Python pyplot.FuncFormatter方法代码示例

    本文整理汇总了Python中matplotlib.pyplot.FuncFormatter方法的典型用法代码示例.如果您正苦于以下问题:Python pyplot.FuncFormatter方法的具体 ...

  5. python中bind的用法_Python socket.bind方法代码示例

    本文整理汇总了Python中socket.bind方法的典型用法代码示例.如果您正苦于以下问题:Python socket.bind方法的具体用法?Python socket.bind怎么用?Pyth ...

  6. python中font的用法_Python font.nametofont方法代码示例

    本文整理汇总了Python中tkinter.font.nametofont方法的典型用法代码示例.如果您正苦于以下问题:Python font.nametofont方法的具体用法?Python fon ...

  7. java中intvalue_Java Byte类intValue()方法的示例

    java中intvalue 字节类intValue()方法 (Byte class intValue() method) intValue() method is available in java. ...

  8. java中intvalue_Java Short类intValue()方法及示例

    java中intvalue 短类intValue()方法 (Short class intValue() method) intValue() method is available in java. ...

  9. java中intvalue_Java Float类intValue()方法与示例

    java中intvalue 浮动类intValue()方法 (Float class intValue() method) intValue() method is available in java ...

  10. java中multiply用法_Java BigInteger multiply()用法及代码示例

    java.math.BigInteger.multiply(BigInteger val)用于计算两个BigInteger的乘法.由于BigInteger类内部使用整数数组进行处理,因此对BigInt ...

最新文章

  1. struts2学习笔记--线程安全问题小结
  2. Halcon 彩色图片通道分割处理
  3. 引用asp.net母版页后,母版页和内容页的页面事件执行顺序
  4. 快速学习使用 Windows Azure 上的 SharePoint Server 2013
  5. [20180102]11g的V$SORT_USAGE视图.txt
  6. HTML/CSS——PC端QQ飞车官网首页
  7. windows cmd下的转义符
  8. vc给exe更改图标
  9. [目标检测] Faster R-CNN 深入理解 amp;amp; 改进方法汇总
  10. oracle设置禁用外键,oracle禁用表外键
  11. C++ 和ws2def.h相关的一坨错误
  12. Ubuntu NumPy 安装
  13. 爬虫——获取联行行号
  14. 一文读懂“什么是Web 1.0,Web 2.0,Web 3.0?”
  15. 无需越狱或安装应用在 iPhone 和 iPad 上打开 Flash 视频
  16. C++无法输出txt文件全部内容以及输出出现乱码的解决方法
  17. JAVA开发运维(云基础设备监控)
  18. HTML网页设计制作大作业(div+css)---浩瀚天文 (13页有二级菜单)
  19. YOLOv5系列(2)——YOLOv5导出jit,onnx,engine
  20. 全国天气降水量预报图接口 天气预报云图接口

热门文章

  1. 怎样检查c语言程序的问题,C语言陷阱与技巧第24节,做代码选择,不一定都要使用 if 判断的...
  2. nginx nodejs环境配置_Linux 环境变量配置(Nodejs/MongoDB/JDK/Nginx)
  3. sql 日期和当前日期时间差_SQL基础进阶16日期处理
  4. join 子查询 效率_MySQL之多表查询
  5. xstream-0 使用入门
  6. 20172311 2017-2018-2 《程序设计与数据结构》实验一报告
  7. Cloudera Manager 和 CDH 4 终极安装
  8. 10分钟利用django搭建一个博客
  9. Nokia5230连接电脑无线上网
  10. 创建一个单选框的html代码是,HTML试题(超有用).doc