🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: cn.bbs.comp.lang.java
Article #11973

java��������Ľ��(ZZ)

#11973
From: ������
Date: Mon, 23 Aug 2004 14:34
29 lines
3094 bytes
�ڻ���JAVA�ı���У��������������ֵĴ��P��ʾ�����⣬����һ���������ʺš�
������ΪJAVA��Ĭ�ϵı��뷽ʽ��UNICODE�����й���ͨ��ʹ�õ��ļ���DB���ǻ���GB2312����BIG5�ȱ��룬�ʻ���ִ����⡣��ǰ��Ҳ����Ϊ����������գ�����������Щ���ϣ����ڽ���ˣ���֪��һ���кܶ�����Ҳ������������⣬�����ؾ��ܽ���һ�£����ó����ô��һ�������
��
1������ҳ��������ġ�
JAVA�����紫����ʹ�õı�����"ISO-8859-1"���������ʱ��Ҫ����ת�����磺
String  str="����";
str=new  String(str.getBytes("GB2312"),"8859_1");
������ڱ������ʱ��ʹ�õı����ǡ�GB2312��,��������ƽ̨�����д˳��򣬲�����ִ����⣬һ��Ҫע�⡣
2���Ӳ����ж�ȡ����
�����������ҳ������෴�磺
str=new  String(str.getBytes("8859_1"),"GB2312");
3������DB���������
һ���ϼ򵥵ķ����ǣ��ڡ�������⡱�У��ѡ���������Ϊ��Ӣ��(����)��������������룬���ɽ����������ã�
ȡ����ʱ��str=new  String(str.getBytes("GB2312"));
��DB���������ģ�str=new  String(str.getBytes("ISO-8859-1"));

4����JSP�е����Ľ����

�ڡ�������⡱�У��ѡ���������Ϊ��Ӣ��(����)��.
��JSPҳ���м��룺
���������ʾ����Ҫ���������ת����
�磺name=new  String(name.getBytes("ISO-8859-1"),"GBK");
�Ͳ���������������ˡ� --

û�к���׳�ֻ����һ�䣺

~~���죬���Լ��ˮ����

�� ��Դ:�������ʵBBS bbs.tju.edu.cn��[FROM: 202.113.12.91]
Technical Details
Message-ID: <4DjUDZ$AaN@bbs.tju.edu.cn>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news1.google.com!news.glorb.com!newsfeed2.orangenet.dk!newsfeed.orangenet.dk!newsfeed.simtel.ru!Simtel.RU!news.bylinux.net!netnews.sdu.edu.cn!news2.happynet.org!TJUBBS

Show Full Headers
Complete Article Headers
X-Google-Thread: f6cb0,cda405f0270a8e65,start
X-Google-Attributes: gidf6cb0,public
X-Google-Language: Chinese,GB
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news1.google.com!news.glorb.com!newsfeed2.orangenet.dk!newsfeed.orangenet.dk!newsfeed.simtel.ru!Simtel.RU!news.bylinux.net!netnews.sdu.edu.cn!news2.happynet.org!TJUBBS
From: trotin.bbs@bbs.tju.edu.cn.no.spam (������)
Newsgroups: cn.bbs.comp.lang.java
Subject: java��������Ľ��(ZZ)
Date: 23 Aug 2004 14:34:59 GMT
Organization: �����ʵBBSվ
Message-ID: <4DjUDZ$AaN@bbs.tju.edu.cn>
Mime-Version: 1.0
Content-Type: text/plain; charset="gb2312"
Content-Transfer-Encoding: 8bit
X-Filename: Java/M.1093271699.A
Lines: 29