解决java中文问题
针对applet和awt
Font f = new Font(UIResourcegetString( Default_font)FontPLAIN);
UIManagerput(Labelfontf);
UIManagerput(LabelforegroundColorblack);
UIManagerput(Buttonfontf);
UIManagerput(Menufontf);
UIManagerput(MenuItemfontf);
UIManagerput(Listfontf);
UIManagerput(CheckBoxfontf);
UIManagerput(RadioButtonfontf);
UIManagerput(ComboBoxfontf);
UIManagerput(TextAreafontf);
Font f = new Font(隶书FontPLAIN);
UIManagerput(Buttonfontfont);
UIManagerput(ToggleButtonfontfont);
UIManagerput(RadioButtonfontfont);
UIManagerput(CheckBoxfontfont);
UIManagerput(ColorChooserfontfont);
UIManagerput(ToggleButtonfontfont);
UIManagerput(ComboBoxfontfont);
UIManagerput(ComboBoxItemfontfont);
UIManagerput(InternalFrametitleFontfont);
UIManagerput(Labelfontfont);
UIManagerput(Listfontfont);
UIManagerput(MenuBarfontfont);
UIManagerput(Menufontfont);
UIManagerput(MenuItemfontfont);
UIManagerput(RadioButtonMenuItemfontfont);
UIManagerput(CheckBoxMenuItemfontfont);
UIManagerput(PopupMenufontfont);
UIManagerput(OptionPanefontfont);
UIManagerput(Panelfontfont);
UIManagerput(ProgressBarfontfont);
UIManagerput(ScrollPanefontfont);
UIManagerput(Viewportfont);
UIManagerput(TabbedPanefontfont);
UIManagerput(TableHeaderfontfont);
UIManagerput(TextFieldfontfont);
UIManagerput(PasswordFiledfontfont);
UIManagerput(TextAreafontfont);
UIManagerput(TextPanefontfont);
UIManagerput(EditorPanefontfont);
UIManagerput(TitledBorderfontfont);
UIManagerput(ToolBarfontfont);
UIManagerput(ToolTipfontfont);
UIManagerput(Treefontfont);
3针对jsp和servlet
解决办法
第一
:在jsp页面加入
<%@ page contentType=text/html; charset=gb %>
:在servlet里面:
public void doGet(HttpServletRequest request HttpServletResponse response) throws ServletException IOException {
responsesetContentType(text/html; charset=gb);//这是重要的
:上面的如果在不行就用如下的方法在数据入库前进行调用
public static String UnicodeToChinese(String s){
try{
if(s==null||sequals()) return ;
String newstring=null;
newstring=new String(sgetBytes(ISO_)gb);
return newstring;
}
catch(UnsupportedEncodingException e)
{
return s;
}
}
public static String ChineseToUnicode(String s){
try{
if(s==null||sequals()) return ;
String newstring=null;
newstring=new String(sgetBytes(gb)ISO_);
return newstring;
}
catch(UnsupportedEncodingException e)
{
return s;
}
}
解决weblogic/webshpere中文问题
在webxml文件中需要配置中文环境r如下
<contextparam>
<paramname>weblogic*</paramname>
<paramvalue>GB</paramvalue>
</contextparam>