日期:2014-05-17  浏览次数:20819 次

jsp乱码,在线等!!!!!
jsp网页显示乱码,字符设置没有问题,其它显示正常。
sql语句:select convert(char(10),a.statime,120)as date,a.cnum,a.income,b.payout,(a.income-b.payout)as benifit,substring(convert(char(20),round(((a.income-b.payout)/a.income)*100,2)),1,4)+'%' as rate from (select statime,sum(cnum)as cnum,cast(sum(cnum*fee)as dec(11,2))as income from sms_sp_sta group by statime)a left join
(select statime,cast(sum(adfee*cnum)as dec(11,2))as payout from sms_cp_sta group by statime)b
on a.statime=b.statime union select '合计',sum(t.cnum),sum(t.income),sum(t.payout),sum(t.income)-sum(t.payout),''from (select convert(char(10),a.statime,120)as date,a.cnum,a.income,b.payout,substring(convert(char(20),round(((a.income-b.payout)/a.income)*100,2)),1,4)+'%' as rate from (select statime,sum(cnum)as cnum,cast(sum(cnum*fee)as dec(11,2))as income from sms_sp_sta group by statime)a left join
(select statime,cast(sum(adfee*cnum)as dec(11,2))as payout from sms_cp_sta group by statime)b
on a.statime=b.statime)t order by date desc"
其中‘合计‘在网页中显示不出来,request.setCharacterEncoding();已经试过,不行,怎么样才能让'合计'显示出来


------解决方案--------------------
你工程的编码和JSP的编码一致应该就可以了。 。要不和数据库的编码也一致就么问题 然后写一个请求和响应的中文字符过滤器。
------解决方案--------------------
探讨
结果没有问题,其它的网页都没有问题
数据库中执行:
合计 2661758 1421780.55 1087682.25 334098.30
网页中执行结果:
???? 2661758 1421780.55 1087682.25 334098.30