- 浏览: 13952 次
- 性别:
- 来自: 北京
最近访客 更多访客>>
文章分类
最新评论
-
北极光之吻:
学习了,继续学习...问一下啊,java有没有办法实现类似:用 ...
java中使用scoket模拟http post请求发送图片或文件
CharacterEncoding
工作中需要,重写了HttpServletResponseWrapper,重写后运行。没啥问题。就是在响应特定类型JS请求时总是出现编码问题。后台报空指针异常(java.io.UnsupportedEncodingException: null)。郁闷了。找!..........
终于发现了,我在设置编码的时候用的字段为“UTF-8”,而重写的类会根据此Key,查找对应的编码值。而sun.io.CharacterEncoding中存储的KEY为“utf-8”和“utf8”,并没有我给的“UTF-8”。。。。书写不规范害我不浅,记住了。
下面是反射生成的CharacterEncoding源码。可以供大家查阅。
package sun.io; import java.security.AccessController; import java.util.HashMap; import java.util.Locale; import java.util.Map; import sun.security.action.GetPropertyAction; @Deprecated public class CharacterEncoding { private static boolean sjisIsMS932; private static Map aliasTable = new HashMap(460, 1.0F); private static volatile boolean installedAll; public static String aliasName(String paramString) { if (paramString.startsWith("\1")) paramString = paramString.substring(1); String str1 = paramString.toLowerCase(Locale.US); String str2 = (String)aliasTable.get(str1); if ((str2 == null) && (!(installedAll))) { installAll(); str2 = (String)aliasTable.get(str1); } return str2; } private static synchronized void installAll() { if (installedAll) return; GetPropertyAction localGetPropertyAction = new GetPropertyAction("sun.nio.cs.map"); String str = (String)AccessController.doPrivileged(localGetPropertyAction); if (str != null) sjisIsMS932 = str.equalsIgnoreCase("Windows-31J/Shift_JIS"); else sjisIsMS932 = false; aliasTable.put("8859_1", "ISO8859_1"); aliasTable.put("iso_8859-1:1987", "ISO8859_1"); aliasTable.put("iso-ir-100", "ISO8859_1"); aliasTable.put("iso_8859-1", "ISO8859_1"); aliasTable.put("iso-8859-1", "ISO8859_1"); aliasTable.put("iso8859-1", "ISO8859_1"); aliasTable.put("latin1", "ISO8859_1"); aliasTable.put("l1", "ISO8859_1"); aliasTable.put("ibm819", "ISO8859_1"); aliasTable.put("ibm-819", "ISO8859_1"); aliasTable.put("cp819", "ISO8859_1"); aliasTable.put("819", "ISO8859_1"); aliasTable.put("csisolatin1", "ISO8859_1"); aliasTable.put("8859_2", "ISO8859_2"); aliasTable.put("iso_8859-2:1987", "ISO8859_2"); aliasTable.put("iso-ir-101", "ISO8859_2"); aliasTable.put("iso_8859-2", "ISO8859_2"); aliasTable.put("iso-8859-2", "ISO8859_2"); aliasTable.put("iso8859-2", "ISO8859_2"); aliasTable.put("latin2", "ISO8859_2"); aliasTable.put("l2", "ISO8859_2"); aliasTable.put("ibm912", "ISO8859_2"); aliasTable.put("ibm-912", "ISO8859_2"); aliasTable.put("cp912", "ISO8859_2"); aliasTable.put("912", "ISO8859_2"); aliasTable.put("csisolatin2", "ISO8859_2"); aliasTable.put("8859_3", "ISO8859_3"); aliasTable.put("iso_8859-3:1988", "ISO8859_3"); aliasTable.put("iso-ir-109", "ISO8859_3"); aliasTable.put("iso_8859-3", "ISO8859_3"); aliasTable.put("iso-8859-3", "ISO8859_3"); aliasTable.put("iso8859-3", "ISO8859_3"); aliasTable.put("latin3", "ISO8859_3"); aliasTable.put("l3", "ISO8859_3"); aliasTable.put("ibm913", "ISO8859_3"); aliasTable.put("ibm-913", "ISO8859_3"); aliasTable.put("cp913", "ISO8859_3"); aliasTable.put("913", "ISO8859_3"); aliasTable.put("csisolatin3", "ISO8859_3"); aliasTable.put("8859_4", "ISO8859_4"); aliasTable.put("iso_8859-4:1988", "ISO8859_4"); aliasTable.put("iso-ir-110", "ISO8859_4"); aliasTable.put("iso_8859-4", "ISO8859_4"); aliasTable.put("iso-8859-4", "ISO8859_4"); aliasTable.put("iso8859-4", "ISO8859_4"); aliasTable.put("latin4", "ISO8859_4"); aliasTable.put("l4", "ISO8859_4"); aliasTable.put("ibm914", "ISO8859_4"); aliasTable.put("ibm-914", "ISO8859_4"); aliasTable.put("cp914", "ISO8859_4"); aliasTable.put("914", "ISO8859_4"); aliasTable.put("csisolatin4", "ISO8859_4"); aliasTable.put("8859_5", "ISO8859_5"); aliasTable.put("iso_8859-5:1988", "ISO8859_5"); aliasTable.put("iso-ir-144", "ISO8859_5"); aliasTable.put("iso_8859-5", "ISO8859_5"); aliasTable.put("iso-8859-5", "ISO8859_5"); aliasTable.put("iso8859-5", "ISO8859_5"); aliasTable.put("cyrillic", "ISO8859_5"); aliasTable.put("csisolatincyrillic", "ISO8859_5"); aliasTable.put("ibm915", "ISO8859_5"); aliasTable.put("ibm-915", "ISO8859_5"); aliasTable.put("cp915", "ISO8859_5"); aliasTable.put("915", "ISO8859_5"); aliasTable.put("8859_6", "ISO8859_6"); aliasTable.put("iso_8859-6:1987", "ISO8859_6"); aliasTable.put("iso-ir-127", "ISO8859_6"); aliasTable.put("iso_8859-6", "ISO8859_6"); aliasTable.put("iso-8859-6", "ISO8859_6"); aliasTable.put("iso8859-6", "ISO8859_6"); aliasTable.put("ecma-114", "ISO8859_6"); aliasTable.put("asmo-708", "ISO8859_6"); aliasTable.put("arabic", "ISO8859_6"); aliasTable.put("csisolatinarabic", "ISO8859_6"); aliasTable.put("ibm1089", "ISO8859_6"); aliasTable.put("ibm-1089", "ISO8859_6"); aliasTable.put("cp1089", "ISO8859_6"); aliasTable.put("1089", "ISO8859_6"); aliasTable.put("8859_7", "ISO8859_7"); aliasTable.put("iso_8859-7:1987", "ISO8859_7"); aliasTable.put("iso-ir-126", "ISO8859_7"); aliasTable.put("iso_8859-7", "ISO8859_7"); aliasTable.put("iso-8859-7", "ISO8859_7"); aliasTable.put("iso8859-7", "ISO8859_7"); aliasTable.put("elot_928", "ISO8859_7"); aliasTable.put("ecma-118", "ISO8859_7"); aliasTable.put("greek", "ISO8859_7"); aliasTable.put("greek8", "ISO8859_7"); aliasTable.put("csisolatingreek", "ISO8859_7"); aliasTable.put("ibm813", "ISO8859_7"); aliasTable.put("ibm-813", "ISO8859_7"); aliasTable.put("cp813", "ISO8859_7"); aliasTable.put("813", "ISO8859_7"); aliasTable.put("sun_eu_greek", "ISO8859_7"); aliasTable.put("8859_8", "ISO8859_8"); aliasTable.put("iso_8859-8:1988", "ISO8859_8"); aliasTable.put("iso-ir-138", "ISO8859_8"); aliasTable.put("iso_8859-8", "ISO8859_8"); aliasTable.put("iso-8859-8", "ISO8859_8"); aliasTable.put("iso8859-8", "ISO8859_8"); aliasTable.put("hebrew", "ISO8859_8"); aliasTable.put("csisolatinhebrew", "ISO8859_8"); aliasTable.put("ibm916", "ISO8859_8"); aliasTable.put("ibm-916", "ISO8859_8"); aliasTable.put("cp916", "ISO8859_8"); aliasTable.put("916", "ISO8859_8"); aliasTable.put("8859_9", "ISO8859_9"); aliasTable.put("iso-ir-148", "ISO8859_9"); aliasTable.put("iso_8859-9", "ISO8859_9"); aliasTable.put("iso-8859-9", "ISO8859_9"); aliasTable.put("iso8859-9", "ISO8859_9"); aliasTable.put("latin5", "ISO8859_9"); aliasTable.put("l5", "ISO8859_9"); aliasTable.put("ibm920", "ISO8859_9"); aliasTable.put("ibm-920", "ISO8859_9"); aliasTable.put("cp920", "ISO8859_9"); aliasTable.put("920", "ISO8859_9"); aliasTable.put("csisolatin5", "ISO8859_9"); aliasTable.put("8859_13", "ISO8859_13"); aliasTable.put("iso_8859-13", "ISO8859_13"); aliasTable.put("iso-8859-13", "ISO8859_13"); aliasTable.put("iso8859-13", "ISO8859_13"); aliasTable.put("8859_15", "ISO8859_15"); aliasTable.put("iso-8859-15", "ISO8859_15"); aliasTable.put("iso_8859-15", "ISO8859_15"); aliasTable.put("iso8859-15", "ISO8859_15"); aliasTable.put("ibm923", "ISO8859_15"); aliasTable.put("ibm-923", "ISO8859_15"); aliasTable.put("cp923", "ISO8859_15"); aliasTable.put("923", "ISO8859_15"); aliasTable.put("latin0", "ISO8859_15"); aliasTable.put("latin9", "ISO8859_15"); aliasTable.put("csisolatin0", "ISO8859_15"); aliasTable.put("csisolatin9", "ISO8859_15"); aliasTable.put("iso8859_15_fdis", "ISO8859_15"); aliasTable.put("utf-8", "UTF8"); aliasTable.put("unicode-1-1-utf-8", "UTF8"); aliasTable.put("unicode-1-1", "UnicodeBigUnmarked"); aliasTable.put("iso-10646-ucs-2", "UnicodeBigUnmarked"); aliasTable.put("utf-16be", "UnicodeBigUnmarked"); aliasTable.put("utf-16le", "UnicodeLittleUnmarked"); aliasTable.put("utf-16", "UTF16"); aliasTable.put("x-utf-16be", "UnicodeBigUnmarked"); aliasTable.put("x-utf-16le", "UnicodeLittleUnmarked"); aliasTable.put("unicode", "Unicode"); aliasTable.put("ibm037", "Cp037"); aliasTable.put("ibm-037", "Cp037"); aliasTable.put("cp037", "Cp037"); aliasTable.put("037", "Cp037"); aliasTable.put("ibm273", "Cp273"); aliasTable.put("ibm-273", "Cp273"); aliasTable.put("cp273", "Cp273"); aliasTable.put("273", "Cp273"); aliasTable.put("ibm277", "Cp277"); aliasTable.put("ibm-277", "Cp277"); aliasTable.put("cp277", "Cp277"); aliasTable.put("277", "Cp277"); aliasTable.put("ibm278", "Cp278"); aliasTable.put("ibm-278", "Cp278"); aliasTable.put("cp278", "Cp278"); aliasTable.put("278", "Cp278"); aliasTable.put("ibm280", "Cp280"); aliasTable.put("ibm-280", "Cp280"); aliasTable.put("cp280", "Cp280"); aliasTable.put("280", "Cp280"); aliasTable.put("ibm284", "Cp284"); aliasTable.put("ibm-284", "Cp284"); aliasTable.put("cp284", "Cp284"); aliasTable.put("284", "Cp284"); aliasTable.put("ibm285", "Cp285"); aliasTable.put("ibm-285", "Cp285"); aliasTable.put("cp285", "Cp285"); aliasTable.put("285", "Cp285"); aliasTable.put("ibm297", "Cp297"); aliasTable.put("ibm-297", "Cp297"); aliasTable.put("cp297", "Cp297"); aliasTable.put("297", "Cp297"); aliasTable.put("ibm420", "Cp420"); aliasTable.put("ibm-420", "Cp420"); aliasTable.put("cp420", "Cp420"); aliasTable.put("420", "Cp420"); aliasTable.put("ibm424", "Cp424"); aliasTable.put("ibm-424", "Cp424"); aliasTable.put("cp424", "Cp424"); aliasTable.put("424", "Cp424"); aliasTable.put("ibm437", "Cp437"); aliasTable.put("ibm-437", "Cp437"); aliasTable.put("cp437", "Cp437"); aliasTable.put("437", "Cp437"); aliasTable.put("cspc8codepage437", "Cp437"); aliasTable.put("ibm500", "Cp500"); aliasTable.put("ibm-500", "Cp500"); aliasTable.put("cp500", "Cp500"); aliasTable.put("500", "Cp500"); aliasTable.put("ibm737", "Cp737"); aliasTable.put("ibm-737", "Cp737"); aliasTable.put("cp737", "Cp737"); aliasTable.put("737", "Cp737"); aliasTable.put("ibm775", "Cp775"); aliasTable.put("ibm-775", "Cp775"); aliasTable.put("cp775", "Cp775"); aliasTable.put("775", "Cp775"); aliasTable.put("ibm834", "Cp834"); aliasTable.put("ibm-834", "Cp834"); aliasTable.put("cp834", "Cp834"); aliasTable.put("834", "Cp834"); aliasTable.put("ibm838", "Cp838"); aliasTable.put("ibm-838", "Cp838"); aliasTable.put("cp838", "Cp838"); aliasTable.put("838", "Cp838"); aliasTable.put("ibm850", "Cp850"); aliasTable.put("ibm-850", "Cp850"); aliasTable.put("cp850", "Cp850"); aliasTable.put("850", "Cp850"); aliasTable.put("cspc850multilingual", "Cp850"); aliasTable.put("ibm852", "Cp852"); aliasTable.put("ibm-852", "Cp852"); aliasTable.put("cp852", "Cp852"); aliasTable.put("852", "Cp852"); aliasTable.put("cspcp852", "Cp852"); aliasTable.put("ibm855", "Cp855"); aliasTable.put("ibm-855", "Cp855"); aliasTable.put("cp855", "Cp855"); aliasTable.put("855", "Cp855"); aliasTable.put("cspcp855", "Cp855"); aliasTable.put("ibm856", "Cp856"); aliasTable.put("ibm-856", "Cp856"); aliasTable.put("cp856", "Cp856"); aliasTable.put("856", "Cp856"); aliasTable.put("ibm857", "Cp857"); aliasTable.put("ibm-857", "Cp857"); aliasTable.put("cp857", "Cp857"); aliasTable.put("857", "Cp857"); aliasTable.put("csibm857", "Cp857"); aliasTable.put("ibm860", "Cp860"); aliasTable.put("ibm-860", "Cp860"); aliasTable.put("cp860", "Cp860"); aliasTable.put("860", "Cp860"); aliasTable.put("csibm860", "Cp860"); aliasTable.put("ibm861", "Cp861"); aliasTable.put("ibm-861", "Cp861"); aliasTable.put("cp861", "Cp861"); aliasTable.put("cp-is", "Cp861"); aliasTable.put("861", "Cp861"); aliasTable.put("csibm861", "Cp861"); aliasTable.put("ibm862", "Cp862"); aliasTable.put("ibm-862", "Cp862"); aliasTable.put("cp862", "Cp862"); aliasTable.put("862", "Cp862"); aliasTable.put("cspc862latinhebrew", "Cp862"); aliasTable.put("ibm863", "Cp863"); aliasTable.put("ibm-863", "Cp863"); aliasTable.put("cp863", "Cp863"); aliasTable.put("863", "Cp863"); aliasTable.put("csibm863", "Cp863"); aliasTable.put("ibm864", "Cp864"); aliasTable.put("ibm-864", "Cp864"); aliasTable.put("cp864", "Cp864"); aliasTable.put("csibm864", "Cp864"); aliasTable.put("ibm865", "Cp865"); aliasTable.put("ibm-865", "Cp865"); aliasTable.put("cp865", "Cp865"); aliasTable.put("865", "Cp865"); aliasTable.put("csibm865", "Cp865"); aliasTable.put("ibm866", "Cp866"); aliasTable.put("ibm-866", "Cp866"); aliasTable.put("cp866", "Cp866"); aliasTable.put("866", "Cp866"); aliasTable.put("csibm866", "Cp866"); aliasTable.put("ibm868", "Cp868"); aliasTable.put("ibm-868", "Cp868"); aliasTable.put("cp868", "Cp868"); aliasTable.put("868", "Cp868"); aliasTable.put("ibm869", "Cp869"); aliasTable.put("ibm-869", "Cp869"); aliasTable.put("cp869", "Cp869"); aliasTable.put("869", "Cp869"); aliasTable.put("cp-gr", "Cp869"); aliasTable.put("csibm869", "Cp869"); aliasTable.put("ibm870", "Cp870"); aliasTable.put("ibm-870", "Cp870"); aliasTable.put("cp870", "Cp870"); aliasTable.put("870", "Cp870"); aliasTable.put("ibm871", "Cp871"); aliasTable.put("ibm-871", "Cp871"); aliasTable.put("cp871", "Cp871"); aliasTable.put("871", "Cp871"); aliasTable.put("ibm874", "Cp874"); aliasTable.put("ibm-874", "Cp874"); aliasTable.put("cp874", "Cp874"); aliasTable.put("874", "Cp874"); aliasTable.put("ibm875", "Cp875"); aliasTable.put("ibm-875", "Cp875"); aliasTable.put("cp875", "Cp875"); aliasTable.put("875", "Cp875"); aliasTable.put("ibm918", "Cp918"); aliasTable.put("ibm-918", "Cp918"); aliasTable.put("cp918", "Cp918"); aliasTable.put("918", "Cp918"); aliasTable.put("ibm921", "Cp921"); aliasTable.put("ibm-921", "Cp921"); aliasTable.put("cp921", "Cp921"); aliasTable.put("921", "Cp921"); aliasTable.put("ibm922", "Cp922"); aliasTable.put("ibm-922", "Cp922"); aliasTable.put("cp922", "Cp922"); aliasTable.put("922", "Cp922"); aliasTable.put("ibm930", "Cp930"); aliasTable.put("ibm-930", "Cp930"); aliasTable.put("cp930", "Cp930"); aliasTable.put("930", "Cp930"); aliasTable.put("ibm933", "Cp933"); aliasTable.put("ibm-933", "Cp933"); aliasTable.put("cp933", "Cp933"); aliasTable.put("933", "Cp933"); aliasTable.put("ibm935", "Cp935"); aliasTable.put("ibm-935", "Cp935"); aliasTable.put("cp935", "Cp935"); aliasTable.put("935", "Cp935"); aliasTable.put("ibm937", "Cp937"); aliasTable.put("ibm-937", "Cp937"); aliasTable.put("cp937", "Cp937"); aliasTable.put("937", "Cp937"); aliasTable.put("ibm939", "Cp939"); aliasTable.put("ibm-939", "Cp939"); aliasTable.put("cp939", "Cp939"); aliasTable.put("939", "Cp939"); aliasTable.put("ibm942", "Cp942"); aliasTable.put("ibm-942", "Cp942"); aliasTable.put("cp942", "Cp942"); aliasTable.put("942", "Cp942"); aliasTable.put("ibm943", "Cp943"); aliasTable.put("ibm-943", "Cp943"); aliasTable.put("cp943", "Cp943"); aliasTable.put("943", "Cp943"); aliasTable.put("ibm948", "Cp948"); aliasTable.put("ibm-948", "Cp948"); aliasTable.put("cp948", "Cp948"); aliasTable.put("948", "Cp948"); aliasTable.put("ibm949", "Cp949"); aliasTable.put("ibm-949", "Cp949"); aliasTable.put("cp949", "Cp949"); aliasTable.put("949", "Cp949"); aliasTable.put("ibm950", "Cp950"); aliasTable.put("ibm-950", "Cp950"); aliasTable.put("cp950", "Cp950"); aliasTable.put("950", "Cp950"); aliasTable.put("ibm964", "Cp964"); aliasTable.put("ibm-964", "Cp964"); aliasTable.put("cp964", "Cp964"); aliasTable.put("964", "Cp964"); aliasTable.put("ibm970", "Cp970"); aliasTable.put("ibm-970", "Cp970"); aliasTable.put("cp970", "Cp970"); aliasTable.put("970", "Cp970"); aliasTable.put("ibm1006", "Cp1006"); aliasTable.put("ibm-1006", "Cp1006"); aliasTable.put("cp1006", "Cp1006"); aliasTable.put("1006", "Cp1006"); aliasTable.put("ibm1025", "Cp1025"); aliasTable.put("ibm-1025", "Cp1025"); aliasTable.put("cp1025", "Cp1025"); aliasTable.put("1025", "Cp1025"); aliasTable.put("ibm1026", "Cp1026"); aliasTable.put("ibm-1026", "Cp1026"); aliasTable.put("cp1026", "Cp1026"); aliasTable.put("1026", "Cp1026"); aliasTable.put("ibm1097", "Cp1097"); aliasTable.put("ibm-1097", "Cp1097"); aliasTable.put("cp1097", "Cp1097"); aliasTable.put("1097", "Cp1097"); aliasTable.put("ibm1098", "Cp1098"); aliasTable.put("ibm-1098", "Cp1098"); aliasTable.put("cp1098", "Cp1098"); aliasTable.put("1098", "Cp1098"); aliasTable.put("ibm1112", "Cp1112"); aliasTable.put("ibm-1112", "Cp1112"); aliasTable.put("cp1112", "Cp1112"); aliasTable.put("1112", "Cp1112"); aliasTable.put("ibm1122", "Cp1122"); aliasTable.put("ibm-1122", "Cp1122"); aliasTable.put("cp1122", "Cp1122"); aliasTable.put("1122", "Cp1122"); aliasTable.put("ibm1123", "Cp1123"); aliasTable.put("ibm-1123", "Cp1123"); aliasTable.put("cp1123", "Cp1123"); aliasTable.put("1123", "Cp1123"); aliasTable.put("ibm1124", "Cp1124"); aliasTable.put("ibm-1124", "Cp1124"); aliasTable.put("cp1124", "Cp1124"); aliasTable.put("1124", "Cp1124"); aliasTable.put("ibm1381", "Cp1381"); aliasTable.put("ibm-1381", "Cp1381"); aliasTable.put("cp1381", "Cp1381"); aliasTable.put("1381", "Cp1381"); aliasTable.put("ibm1383", "Cp1383"); aliasTable.put("ibm-1383", "Cp1383"); aliasTable.put("cp1383", "Cp1383"); aliasTable.put("1383", "Cp1383"); aliasTable.put("jis auto detect", "JISAutoDetect"); aliasTable.put("jis", "ISO2022JP"); aliasTable.put("iso-2022-jp", "ISO2022JP"); aliasTable.put("csiso2022jp", "ISO2022JP"); aliasTable.put("jis_encoding", "ISO2022JP"); aliasTable.put("csjisencoding", "ISO2022JP"); aliasTable.put("windows-31j", "MS932"); aliasTable.put("cswindows31j", "MS932"); aliasTable.put("シフト符号化表現", "SJIS"); aliasTable.put("pck", "PCK"); if (sjisIsMS932) { aliasTable.put("shift_jis", "MS932"); aliasTable.put("csshiftjis", "MS932"); aliasTable.put("x-sjis", "MS932"); aliasTable.put("ms_kanji", "MS932"); } else { aliasTable.put("shift_jis", "SJIS"); aliasTable.put("csshiftjis", "SJIS"); aliasTable.put("x-sjis", "SJIS"); aliasTable.put("ms_kanji", "SJIS"); } aliasTable.put("eucjis", "EUC_JP"); aliasTable.put("euc-jp", "EUC_JP"); aliasTable.put("eucjp", "EUC_JP"); aliasTable.put("extended_unix_code_packed_format_for_japanese", "EUC_JP"); aliasTable.put("cseucpkdfmtjapanese", "EUC_JP"); aliasTable.put("x-euc-jp", "EUC_JP"); aliasTable.put("x-eucjp", "EUC_JP"); aliasTable.put("eucjp-open", "EUC_JP_Solaris"); aliasTable.put("euc-jp-linux", "EUC_JP_LINUX"); aliasTable.put("windows-874", "MS874"); aliasTable.put("windows-1250", "Cp1250"); aliasTable.put("windows-1251", "Cp1251"); aliasTable.put("ansi-1251", "Cp1251"); aliasTable.put("windows-1252", "Cp1252"); aliasTable.put("windows-1253", "Cp1253"); aliasTable.put("windows-1254", "Cp1254"); aliasTable.put("windows-1255", "Cp1255"); aliasTable.put("windows-1256", "Cp1256"); aliasTable.put("windows-1257", "Cp1257"); aliasTable.put("windows-1258", "Cp1258"); aliasTable.put("ibm33722", "Cp33722"); aliasTable.put("ibm-33722", "Cp33722"); aliasTable.put("cp33722", "Cp33722"); aliasTable.put("33722", "Cp33722"); aliasTable.put("koi8-r", "KOI8_R"); aliasTable.put("koi8", "KOI8_R"); aliasTable.put("cskoi8r", "KOI8_R"); aliasTable.put("gb2312", "EUC_CN"); aliasTable.put("gb2312-80", "EUC_CN"); aliasTable.put("gb2312-1980", "EUC_CN"); aliasTable.put("euc-cn", "EUC_CN"); aliasTable.put("euccn", "EUC_CN"); aliasTable.put("big5", "Big5"); aliasTable.put("big5hk", "Big5_HKSCS"); aliasTable.put("big5-hkscs", "Big5_HKSCS"); aliasTable.put("big5-hkscs:unicode3.0", "Big5_HKSCS"); aliasTable.put("big5_solaris", "Big5_Solaris"); aliasTable.put("cns11643", "EUC_TW"); aliasTable.put("euc-tw", "EUC_TW"); aliasTable.put("euctw", "EUC_TW"); aliasTable.put("ksc5601", "EUC_KR"); aliasTable.put("euc-kr", "EUC_KR"); aliasTable.put("euckr", "EUC_KR"); aliasTable.put("ks_c_5601-1987", "EUC_KR"); aliasTable.put("ksc5601-1987", "EUC_KR"); aliasTable.put("ksc5601_1987", "EUC_KR"); aliasTable.put("ksc_5601", "EUC_KR"); aliasTable.put("5601", "EUC_KR"); aliasTable.put("ksc5601-1992", "Johab"); aliasTable.put("ksc5601_1992", "Johab"); aliasTable.put("ms1361", "Johab"); aliasTable.put("windows-949", "MS949"); aliasTable.put("iso-2022-kr", "ISO2022KR"); aliasTable.put("csiso2022kr", "ISO2022KR"); aliasTable.put("tis620.2533", "TIS620"); aliasTable.put("tis-620", "TIS620"); aliasTable.put("x-compound-text", "COMPOUND_TEXT"); aliasTable.put("x11-compound_text", "COMPOUND_TEXT"); aliasTable.put("cp942c", "Cp942C"); aliasTable.put("cp943c", "Cp943C"); aliasTable.put("cp949c", "Cp949C"); aliasTable.put("iscii", "ISCII91"); installedAll = true; } static String getSJISName() { String str = (String)AccessController.doPrivileged(new 1()); if (str != null) { if (str.equals("MS932")) return str; str = aliasName(str); } return (((str != null) && (str.equals("MS932"))) ? str : "SJIS"); } static String getEUCJPName() { String str = (String)AccessController.doPrivileged(new 2()); return str; } static { aliasTable.put("us-ascii", "ASCII"); aliasTable.put("ascii", "ASCII"); aliasTable.put("646", "ASCII"); aliasTable.put("iso_646.irv:1983", "ASCII"); aliasTable.put("ansi_x3.4-1968", "ASCII"); aliasTable.put("iso646-us", "ASCII"); aliasTable.put("default", "ASCII"); aliasTable.put("ascii7", "ASCII"); aliasTable.put("8859_1", "ISO8859_1"); aliasTable.put("iso8859_1", "ISO8859_1"); aliasTable.put("utf-8", "UTF8"); aliasTable.put("utf8", "UTF8"); aliasTable.put("utf-16le", "UnicodeLittleUnmarked"); aliasTable.put("iso8859-1", "ISO8859_1"); aliasTable.put("iso8859-2", "ISO8859_2"); aliasTable.put("iso8859-4", "ISO8859_4"); aliasTable.put("iso8859-5", "ISO8859_5"); aliasTable.put("iso8859-6", "ISO8859_6"); aliasTable.put("iso8859-8", "ISO8859_8"); aliasTable.put("iso8859-9", "ISO8859_9"); aliasTable.put("iso8859-13", "ISO8859_13"); aliasTable.put("iso8859-15", "ISO8859_15"); aliasTable.put("5601", "EUC_KR"); aliasTable.put("ansi-1251", "Cp1251"); aliasTable.put("big5", "Big5"); aliasTable.put("big5hk", "Big5_HKSCS"); aliasTable.put("eucjp", "EUC_JP"); aliasTable.put("cns11643", "EUC_TW"); aliasTable.put("gb2312", "EUC_CN"); aliasTable.put("gb18030", "GB18030"); aliasTable.put("gbk", "GBK"); aliasTable.put("koi8-r", "KOI8_R"); aliasTable.put("tis620.2533", "TIS620"); aliasTable.put("cp1250", "Cp1250"); aliasTable.put("cp1251", "Cp1251"); aliasTable.put("cp1252", "Cp1252"); aliasTable.put("cp1253", "Cp1253"); aliasTable.put("cp1254", "Cp1254"); aliasTable.put("cp1255", "Cp1255"); aliasTable.put("cp1256", "Cp1256"); aliasTable.put("cp1257", "Cp1257"); aliasTable.put("cp1258", "Cp1258"); aliasTable.put("ms874", "MS874"); aliasTable.put("ms932", "MS932"); aliasTable.put("ms949", "MS949"); aliasTable.put("ms950", "MS950"); aliasTable.put("ms1361", "MS1361"); } }
相关推荐
pub_characterencoding表数据,结合相关函数可以实现oracle汉字转拼音、五笔等相关操作
在本讲中,我们将深入探讨Spring框架中的两个关键特性:CharacterEncodingFilter(字符编码过滤器)和OpenSessionInViewInterceptor(开放会话视图拦截器)。这两个功能在开发Web应用程序时起着至关重要的作用,特别...
"Struts2_1000_CharacterEncoding"这个主题显然关注的是在Struts2框架中如何正确处理字符编码问题,以避免乱码或数据丢失。 在Web应用中,字符编码问题通常出现在以下几个关键点: 1. **HTTP请求**:用户通过...
这里的`useUnicode=true`表示启用Unicode字符集,`characterEncoding=UTF-8`则指定了具体的编码方式。 #### 4. **代码中字符集的统一** 在处理数据库返回的数据时,还需要确保应用程序内部处理字符串时使用的字符...
useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=UTC"; String user = "用户名"; String password = "密码"; Connection conn = DriverManager.getConnection(url, user, password); ``` 3. ...
Spring框架是Java开发中不可或缺的一部分,它为开发者提供了丰富的功能,包括依赖注入、面向切面编程、事务管理等。在处理Web应用时,Spring提供了一些关键特性,如`CharacterEncodingFilter`和`...
MyBatis 目录(?)[-] mybatis实战教程mybatis in action之一开发环境搭建 mybatis实战教程mybatis in action之二以接口的方式编程 mybatis实战教程mybatis in action之三实现数据的增删改查 mybatis实战教程mybatis ...
useUnicode=true&characterEncoding=UTF-8"是一个典型的JDBC连接URL,用于建立Java应用与MySQL数据库之间的连接。这个URL包含了多个关键组成部分: 1. **协议**:jdbc,表示使用Java的数据库连接协议。 2. **数据库...
useUnicode=true&characterEncoding=UTF-8&useSSL=true", "root", "123"); statement = conn.createStatement(); String sql = "INSERT INTO users VALUES (null, '" + uname + "', '" + upass + "', '" + sex +...
useUnicode=true&characterEncoding=utf8 例如: jdbc:mysql://localhost:3306/mydata?useUnicode=true&characterEncoding=utf8 4 、hibernate中url的路径后跟上?characterEncoding=utf8 例如: jdbc:mysql://...
- 对于较旧的版本,如MySQL 4.x,可能需要使用`useUnicode=true&characterEncoding=gbk`,而新版本(如5.0及以上)推荐使用`characterEncoding=utf8`。 6. **错误处理**: - `...
useUnicode=true&characterEncoding=utf8 2.在Web项目中(xml文件)配置proxool,并自动加载 3.导入前台css文件 Html只是实现页面的加载,要实现数据交互就要变成jsp文件 用的是mvc结构的框架
useUnicode=true&characterEncoding=utf8 jdbc:mysql://localhost:3306/XXX?useUnicode=true&characterEncoding=utf8 创建Database时候:create database XXX default character set utf8; 创建表后:...
1、导入数据库2、使用idea打开项目3、更改jdk版本4、修改数据库连接池如果自己是mysql5版本,请修改配置:spring: datasource: driver-class-name: com.mysql.jdbc.Driver username: root password: 123456 url: jdbc:mysql://localhost:3306/deliciousFoods?useUnicode=true&...
推荐使用:谷歌浏览器 ... mysql地址 \src\main\resources\...useUnicode=true&characterEncoding=UTF-8&tinyInt1isBit=false jdbc_username=root jdbc_password=123456 图片存放路径: src\main\webapp\upload
useSSL=false&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true","user":"root","password":"123456"} */; ``` 通过以上步骤,我们可以成功地利用MyCat实现MySQL的读写分离与分表分库。这种配置不仅...
推荐使用:谷歌浏览器 ...useUnicode=true&characterEncoding=utf-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC username: root password: 123456 (数据库密码)
useUnicode=true&characterEncoding=UTF-8&tinyInt1isBit=false jdbc_username=root 数据库用户名 root jdbc_password=123456 用户密码 123456 图片存放路径: src\main\webapp\upload 里面上传图片名里面不能...
SSH 下 MySQL 中文乱码问题解决...首先,在 Hibernate 的配置文件 hibernate.cfg.xml 中需要添加参数 useUnicode=true 和 characterEncoding=UTF-8,以确保 Hibernate 连接 MySQL 数据库时使用 UTF-8 编码。例如: ``` ...