获取jdk支持的编码类型

//获取jdk支持的编码类型
Map<String,Charset> maps = Charset.availableCharsets();
for(Map.Entry<String,Charset> entry:maps.entrySet())
{
String key=entry.getKey();
Charset value=entry.getValue();
// System.out.println(key+"="+value);
System.out.println(key);
}

public static void main(String args[]) {

Locale locale = Locale.getDefault();
System.out.println(locale.getCountry()+","+locale.getLanguage());
//获取jdk支持的编码类型
Map<String, Charset> maps = Charset.availableCharsets();
StringBuilder sb = new StringBuilder();
sb.append("{");
for (Map.Entry<String, Charset> entry : maps.entrySet()) {
String key = entry.getKey();
Charset value = entry.getValue();
sb.append("\"" + key + "\",");
}
sb.deleteCharAt(sb.length() - 1);
sb.append("}");
System.out.println(sb.toString());//数组对象
}

输出:

{"Big5","Big5-HKSCS","CESU-8","EUC-JP","EUC-KR","GB18030","GB2312","GBK","IBM-Thai","IBM00858","IBM01140","IBM01141","IBM01142","IBM01143","IBM01144","IBM01145","IBM01146","IBM01147","IBM01148","IBM01149","IBM037","IBM1026","IBM1047","IBM273","IBM277","IBM278","IBM280","IBM284","IBM285","IBM290","IBM297","IBM420","IBM424","IBM437","IBM500","IBM775","IBM850","IBM852","IBM855","IBM857","IBM860","IBM861","IBM862","IBM863","IBM864","IBM865","IBM866","IBM868","IBM869","IBM870","IBM871","IBM918","ISO-2022-CN","ISO-2022-JP","ISO-2022-JP-2","ISO-2022-KR","ISO-8859-1","ISO-8859-13","ISO-8859-15","ISO-8859-2","ISO-8859-3","ISO-8859-4","ISO-8859-5","ISO-8859-6","ISO-8859-7","ISO-8859-8","ISO-8859-9","JIS_X0201","JIS_X0212-1990","KOI8-R","KOI8-U","Shift_JIS","TIS-620","US-ASCII","UTF-16","UTF-16BE","UTF-16LE","UTF-32","UTF-32BE","UTF-32LE","UTF-8","windows-1250","windows-1251","windows-1252","windows-1253","windows-1254","windows-1255","windows-1256","windows-1257","windows-1258","windows-31j","x-Big5-HKSCS-2001","x-Big5-Solaris","x-euc-jp-Linux","x-EUC-TW","x-eucJP-Open","x-IBM1006","x-IBM1025","x-IBM1046","x-IBM1097","x-IBM1098","x-IBM1112","x-IBM1122","x-IBM1123","x-IBM1124","x-IBM1364","x-IBM1381","x-IBM1383","x-IBM300","x-IBM33722","x-IBM737","x-IBM833","x-IBM834","x-IBM856","x-IBM874","x-IBM875","x-IBM921","x-IBM922","x-IBM930","x-IBM933","x-IBM935","x-IBM937","x-IBM939","x-IBM942","x-IBM942C","x-IBM943","x-IBM943C","x-IBM948","x-IBM949","x-IBM949C","x-IBM950","x-IBM964","x-IBM970","x-ISCII91","x-ISO-2022-CN-CNS","x-ISO-2022-CN-GB","x-iso-8859-11","x-JIS0208","x-JISAutoDetect","x-Johab","x-MacArabic","x-MacCentralEurope","x-MacCroatian","x-MacCyrillic","x-MacDingbat","x-MacGreek","x-MacHebrew","x-MacIceland","x-MacRoman","x-MacRomania","x-MacSymbol","x-MacThai","x-MacTurkish","x-MacUkraine","x-MS932_0213","x-MS950-HKSCS","x-MS950-HKSCS-XP","x-mswin-936","x-PCK","x-SJIS_0213","x-UTF-16LE-BOM","X-UTF-32BE-BOM","X-UTF-32LE-BOM","x-windows-50220","x-windows-50221","x-windows-874","x-windows-949","x-windows-950","x-windows-iso2022jp"}

时间: 2024-10-09 06:19:24

获取jdk支持的编码类型的相关文章

怎样获取文档的编码类型

文档的编码类型主要是 utf-8, 一般是在meta标签的 charset属性上设置. 我们可以通过 document.characterSet 属性获取; document.characterSet; // "UTF-8" 注意: 这个属性只读. 原文地址:https://www.cnblogs.com/aisowe/p/11540003.html

【转】解析JDK 7的动态类型语言支持

http://www.infoq.com/cn/articles/jdk-dynamically-typed-language Java虚拟机的字节码指令集的数量自从Sun公司的第一款Java虚拟机问世至JDK 7来临之前的十余年时间里,一直没有发生任何变化[1].随着JDK 7的发布,字节码指令集终于迎来了第一位新成员——invokedynamic指令.这条新增加的指令是JDK 7实现“动态类型语言(Dynamically Typed Language)”支持而进行的改进之一,也是为JDK 8

Ajax方式提交表单的常见编码类型总结

用Ajax方式提交表单,决定编码类型的是请求头中Content-Type,不同的值对应不同的提交和回调处理方式.而且,在项目中我们会用到前端的库或者框架,他们对于不同的Content-Type也有不同的参数写法,本文将以jQuery和AngularJS,加上XMLHttpRequest共三种方式为例,详细介绍不同Content-Type的发送请求的方式.本文考虑的Content-Type类型,共有如下几种: application/x-www-form-urlencoded multipart/

常见的contentType编码类型【转】

转自https://segmentfault.com/a/1190000006871099 contentType是指http/https发送信息至服务器时的内容编码类型,contentType用于表明发送数据流的类型,服务器根据编码类型使用特定的解析方式,获取数据流中的数据.内容编码类型的作用,有点像本地文件的后缀名. 常见的contentType 一.x-www-form-urlencoded 这是Jquery/Zepto Ajax默认的提交类型.最简例子为: 1 let userInfo

【转载】关于Python脚本开头两行的:#!/usr/bin/python和# -*- coding: utf-8 -*-的作用 &ndash; 指定文件编码类型

下面的内容来自:http://www.cnblogs.com/blueskylcc/p/5332642.html, 对方也是转的,不过没有找到转载的出处: 1.#!/usr/bin/python 是用来说明脚本语言是 python 的 是要用 /usr/bin下面的程序(工具)python,这个解释器,来解释 python 脚本,来运行 python 脚本的. 2.# -*- coding: utf-8 -*- 是用来指定文件编码为 utf-8 的 详情可以参考:PEP 0263 - Defin

【Java/Android性能优 4】PreloadDataCache支持预取的数据缓存,使用简单,支持多种缓存算法,支持不同网络类型,扩展性强

本文转自:http://www.trinea.cn/android/preloaddatacache/ 本文主要介绍一个支持自动向前或向后获取新数据的缓存的使用及功能.Android图片内存缓存可见ImageCache. 主要特性:(1).使用简单  (2).可自动预取新数据  (3).可选择多种缓存算法(包括FIFO.LIFO.LRU.MRU.LFU.MFU等15种)或自定义缓存算法  (4).省流量性能佳(有且仅有一个线程获取数据)  (5).支持不同类型网络处理  (6)缓存可序列化到本地

Android ImageCache图片缓存,使用简单,支持预取,支持多种缓存算法,支持不同网络类型,扩展性强

本文主要介绍一个支持图片自动预取.支持多种缓存算法的图片缓存的使用及功能.图片较大需要SD卡保存情况推荐使用ImageSDCardCache. 与Android LruCache相比主要特性:(1).  使用简单   (2). 轻松获取及预取新图片  (3).  可选择多种缓存算法(FIFO.LIFO.LRU.MRU.LFU.MFU等13种)或自定义缓存算法   (4).  省流量性能佳(有且仅有一个线程获取图片)   (5).  支持不同类型网络处理  (6).  可根据系统配置初始化缓存 

【Java/Android性能优5】 Android ImageCache图片缓存,使用简单,支持预取,支持多种缓存算法,支持不同网络类型,扩展性强

本文转自:http://www.trinea.cn/android/android-imagecache/ 主要介绍一个支持图片自动预取.支持多种缓存算法.支持二级缓存.支持数据保存和恢复的图片缓存的使用.功能及网友反馈的常见问题解答. 与Android LruCache相比主要特性:(1). 使用简单  (2). 轻松获取及预取新图片  (3). 包含二级缓存  (4). 可选择多种缓存算法(FIFO.LIFO.LRU.MRU.LFU.MFU等 13种)或自定义缓存算法  (5). 可方便的保

java获取常见文本文件的编码 解决乱码问题

乱码问题的产生一般是,由字节流转字符流的时候,读文件的编码与文件的系统编码不一致造成的. 解决方式:先自动判断文件系统编码类型,然后读的时候用这个类型去读就ok了. 自动判断文件系统编码类型代码如下, 地址:http://www.cnblogs.com/java0721/archive/2012/07/21/2602963.html java获取常见文本文件的编码 解决乱码问题