0000
作家
作家
  • 铜币143枚
  • 威望34点
  • 贡献值1点
阅读:738回复:3

JAVA客户端与服务器间传送字符串的编码问题[help me out of this fucking puddle~]

楼主#
更多 发布于:2005-09-08 11:12
 工作流程如下:
客户端:
创建对象-->利用dom4j转换成xml文档(encoding=utf-8)-->XML文档转成字符串-->http方式发送到服务器,由服务器servlet接收
服务器:
接收到客户端请求-->利用dom4j将字符串形式的XML转成对象-->对象属性插入数据库(oracle)

但是这样插入到数据库的内容为乱码,如果在服务器上返回客户端发送的请求并在客户端显示出来也是乱码.

已知尝试过的办法:
String special = new request.getParameter("s");//failed
String special = new String(request.getParameter("s").getBytes("gbk"),"utf-8");//failed
String special = new String(request.getParameter("s").getBytes("iso-8859-1"),"utf-8");//failed
request.setCharacterEncoding("UTF-8");//failed
.--. |o_o | |:_/ | // \ \ (| | ) /'\_ _/`\ \___)=(___/
suchasplus
作家
作家
  • 铜币16枚
  • 威望11点
  • 贡献值1点
1C#
发布于:2005-11-08 21:50
Re:JAVA客户端与服务器间传送字符串的编码问题[help me out of this fucking puddle~]
现在严重无聊中~  C#2.0完全看不懂了~  郁闷
The history of these days will be written in blood... By crushing the armies of our enemy, by seizing the weapons they thought to turn against us, we were fighting for our very existence!
W
W
小有名气
小有名气
  • 铜币3枚
  • 威望1点
  • 贡献值0点
2C#
发布于:2005-11-08 20:17
Re:JAVA客户端与服务器间传送字符串的编码问题[help me out of this fucking puddle~]
更改i18n的lang为GB1030呢?
0000
作家
作家
  • 铜币143枚
  • 威望34点
  • 贡献值1点
3C#
发布于:2005-09-09 08:58
Re:JAVA客户端与服务器间传送字符串的编码问题[help me out of this fucking puddle~]
哎.....
.--. |o_o | |:_/ | // \ \ (| | ) /'\_ _/`\ \___)=(___/
游客

返回顶部