各位大侠!!赶紧帮帮我啊,我要疯了!!!!!!!! 晕,用LINUX服务器+SQL SERVER??? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 先确认LINUX的字符集是GBK,然后再对数据库的字符进行编码处理。 我怎么确认LINUX系统的字符集是GBK啊,我对LINUX不太熟练。?能否说的具体些, linux下 的字符集是ISO-8859-1;你需要设定默认的字符集位GB2312或者String.getByte("xxxxx","gb2312") 我怎么在LINUX下设定字符集为GB2312啊,你们回答问题怎么不看看问题就乱说呢看好问题再回答啊。好吗 用LINUX服务器+SQL SERVER???我也觉得比较晕~~怎么安装起来的?呵呵~~我只用过LINUX+ORACEL~~~给你段代码——进行字符转换的ISO-8859-1、 GB2312你试试!!package com.db;import java.lang.*;import java.util.*;import java.lang.Integer;import java.sql.*;public class CharCode{public static String UnicodeToChinese(String s){ try{ if(s==null||s.equals("")) return ""; String newstring=null; newstring=new String(s.getBytes("ISO8859_1"),"gb2312"); return newstring; } catch(Exception e) { return s; } } public static String ChineseToUnicode(String s){ try{ if(s==null||s.equals("")) return ""; String newstring=null; newstring=new String(s.getBytes("gb2312"),"ISO8859_1"); return newstring; } catch(Exception e) { return s; } } } 呵呵,结贴,600分拿来吧~~GOOD LUCK~~:) 找red hat 技术支持咨询一下! 看来能吧sqlserver和linux装载一起的也是高手的说,佩服!不过这种问题看来我们着很难解决了, hql的排序问题 一个关于servlet的问题,望高手请教 JS 给SPAN设置 STYLE 高手啊求9了..帮个忙~~~ 先3Q了 想了解制作WAP网站的问题,不知应该去哪个版块呢? [新手]哪里有大量的 bean 下载? Hibernate 的配置????????????? 请问这是怎么产生的? tomcat安装到jvm.dll文件就停止不动 百分求通用数据库表的web显示!!!! jsp发布静态页有什么好办法吗? 用jrun4.0 如何发布站点?在线等待。马上揭贴 再问Oracle Blob 的数据库插入操作
或者String.getByte("xxxxx","gb2312")
看好问题再回答啊。好吗
我也觉得比较晕~~怎么安装起来的?
呵呵~~
我只用过LINUX+ORACEL~~~给你段代码——进行字符转换的
ISO-8859-1、 GB2312
你试试!!package com.db;import java.lang.*;
import java.util.*;
import java.lang.Integer;
import java.sql.*;public class CharCode{public static String UnicodeToChinese(String s){
try{
if(s==null||s.equals("")) return "";
String newstring=null;
newstring=new String(s.getBytes("ISO8859_1"),"gb2312");
return newstring;
}
catch(Exception e)
{
return s;
}
} public static String ChineseToUnicode(String s){
try{
if(s==null||s.equals("")) return "";
String newstring=null;
newstring=new String(s.getBytes("gb2312"),"ISO8859_1");
return newstring;
}
catch(Exception e)
{
return s;
}
}
}
GOOD LUCK~~
:)