How To Get Supported CharSet From JVM

If you want to view the web page or anything in your system, there must be chartset to support the one used in the web page or files. Most of the web pages would work because the most common charset is English which is by default supported by all the platforms. If you are viewing some other locale languages, then your system should have that charset to view or read the files written in different language.

If you are Java programmer, JVM supports the list of charset which is by default shipped with the package. This example demonstrates how to list all the charsets supported by your JVM. Note that, these chartsets will be different depends on the JVM implementations.

Lets look at the example.
CharSetExample.java

package javabeat.net.io;

import java.nio.charset.Charset;
import java.util.Map;

/**
 * List CharSet in your JVM Example
 *
 * @author krishna
 *
 */
public class CharSetExample {
	public static void main(String[] args) {
		Map charSets = Charset.availableCharsets();
		int i = 1;
		for (Object name : charSets.keySet()){
		   System.out.println("CharSet "+i+" : "+name);
		   i++;
		}
	}
}

If you run the above program, it returns the charsets listed in your JVM.
Ouput…

CharSet 1 : Big5
CharSet 2 : Big5-HKSCS
CharSet 3 : EUC-JP
CharSet 4 : EUC-KR
CharSet 5 : GB18030
CharSet 6 : GB2312
CharSet 7 : GBK
CharSet 8 : IBM-Thai
CharSet 9 : IBM00858
CharSet 10 : IBM01140
CharSet 11 : IBM01141
CharSet 12 : IBM01142
CharSet 13 : IBM01143
CharSet 14 : IBM01144
CharSet 15 : IBM01145
CharSet 16 : IBM01146
CharSet 17 : IBM01147
CharSet 18 : IBM01148
CharSet 19 : IBM01149
CharSet 20 : IBM037
CharSet 21 : IBM1026
CharSet 22 : IBM1047
CharSet 23 : IBM273
CharSet 24 : IBM277
CharSet 25 : IBM278
CharSet 26 : IBM280
CharSet 27 : IBM284
CharSet 28 : IBM285
CharSet 29 : IBM297
CharSet 30 : IBM420
CharSet 31 : IBM424
CharSet 32 : IBM437
CharSet 33 : IBM500
CharSet 34 : IBM775
CharSet 35 : IBM850
CharSet 36 : IBM852
CharSet 37 : IBM855
CharSet 38 : IBM857
CharSet 39 : IBM860
CharSet 40 : IBM861
CharSet 41 : IBM862
CharSet 42 : IBM863
CharSet 43 : IBM864
CharSet 44 : IBM865
CharSet 45 : IBM866
CharSet 46 : IBM868
CharSet 47 : IBM869
CharSet 48 : IBM870
CharSet 49 : IBM871
CharSet 50 : IBM918
CharSet 51 : ISO-2022-CN
CharSet 52 : ISO-2022-JP
CharSet 53 : ISO-2022-JP-2
CharSet 54 : ISO-2022-KR
CharSet 55 : ISO-8859-1
CharSet 56 : ISO-8859-13
CharSet 57 : ISO-8859-15
CharSet 58 : ISO-8859-2
CharSet 59 : ISO-8859-3
CharSet 60 : ISO-8859-4
CharSet 61 : ISO-8859-5
CharSet 62 : ISO-8859-6
CharSet 63 : ISO-8859-7
CharSet 64 : ISO-8859-8
CharSet 65 : ISO-8859-9
CharSet 66 : JIS_X0201
CharSet 67 : JIS_X0212-1990
CharSet 68 : KOI8-R
CharSet 69 : KOI8-U
CharSet 70 : Shift_JIS
CharSet 71 : TIS-620
CharSet 72 : US-ASCII
CharSet 73 : UTF-16
CharSet 74 : UTF-16BE
CharSet 75 : UTF-16LE
CharSet 76 : UTF-32
CharSet 77 : UTF-32BE
CharSet 78 : UTF-32LE
CharSet 79 : UTF-8
CharSet 80 : windows-1250
CharSet 81 : windows-1251
CharSet 82 : windows-1252
CharSet 83 : windows-1253
CharSet 84 : windows-1254
CharSet 85 : windows-1255
CharSet 86 : windows-1256
CharSet 87 : windows-1257
CharSet 88 : windows-1258
CharSet 89 : windows-31j
CharSet 90 : x-Big5-Solaris
CharSet 91 : x-COMPOUND_TEXT
CharSet 92 : x-euc-jp-linux
CharSet 93 : x-EUC-TW
CharSet 94 : x-eucJP-Open
CharSet 95 : x-IBM1006
CharSet 96 : x-IBM1025
CharSet 97 : x-IBM1046
CharSet 98 : x-IBM1097
CharSet 99 : x-IBM1098
CharSet 100 : x-IBM1112
CharSet 101 : x-IBM1122
CharSet 102 : x-IBM1123
CharSet 103 : x-IBM1124
CharSet 104 : x-IBM1381
CharSet 105 : x-IBM1383
CharSet 106 : x-IBM33722
CharSet 107 : x-IBM737
CharSet 108 : x-IBM834
CharSet 109 : x-IBM856
CharSet 110 : x-IBM874
CharSet 111 : x-IBM875
CharSet 112 : x-IBM921
CharSet 113 : x-IBM922
CharSet 114 : x-IBM930
CharSet 115 : x-IBM933
CharSet 116 : x-IBM935
CharSet 117 : x-IBM937
CharSet 118 : x-IBM939
CharSet 119 : x-IBM942
CharSet 120 : x-IBM942C
CharSet 121 : x-IBM943
CharSet 122 : x-IBM943C
CharSet 123 : x-IBM948
CharSet 124 : x-IBM949
CharSet 125 : x-IBM949C
CharSet 126 : x-IBM950
CharSet 127 : x-IBM964
CharSet 128 : x-IBM970
CharSet 129 : x-ISCII91
CharSet 130 : x-ISO-2022-CN-CNS
CharSet 131 : x-ISO-2022-CN-GB
CharSet 132 : x-iso-8859-11
CharSet 133 : x-JIS0208
CharSet 134 : x-JISAutoDetect
CharSet 135 : x-Johab
CharSet 136 : x-MacArabic
CharSet 137 : x-MacCentralEurope
CharSet 138 : x-MacCroatian
CharSet 139 : x-MacCyrillic
CharSet 140 : x-MacDingbat
CharSet 141 : x-MacGreek
CharSet 142 : x-MacHebrew
CharSet 143 : x-MacIceland
CharSet 144 : x-MacRoman
CharSet 145 : x-MacRomania
CharSet 146 : x-MacSymbol
CharSet 147 : x-MacThai
CharSet 148 : x-MacTurkish
CharSet 149 : x-MacUkraine
CharSet 150 : x-MS950-HKSCS
CharSet 151 : x-mswin-936
CharSet 152 : x-PCK
CharSet 153 : x-UTF-16LE-BOM
CharSet 154 : X-UTF-32BE-BOM
CharSet 155 : X-UTF-32LE-BOM
CharSet 156 : x-windows-50220
CharSet 157 : x-windows-50221
CharSet 158 : x-windows-874
CharSet 159 : x-windows-949
CharSet 160 : x-windows-950
CharSet 161 : x-windows-iso2022jp

Comments

comments

About Krishna Srinivasan

He is Founder and Chief Editor of JavaBeat. He has more than 8+ years of experience on developing Web applications. He writes about Spring, DOJO, JSF, Hibernate and many other emerging technologies in this blog.

Speak Your Mind

*