常用默认字符集

1.中文字符转换:

    String newStr =

new String(oldStr.getBytes(oldEncodeSet),newEncodeSet);

    其中oldEncodeSet是原字符集,newEncodeSet是目的字符集.

2.各应用程序的字符编码格式:

    普通Java Application:iso8859-1

    MySQL数据库:gb2312(可选择encoding)

    html表单:iso8859-1

 

你可能感兴趣的:(常用默认字符集)