jsp,java±àÂëÔÀí
Îļþ´ò¿ªÊ±ºòÊÇͨ¹ýÎļþÍ·À´È·¶¨ÎļþµÄ±àÂë
StreamReader sr=new StreamReader(@"F:\cym\temp\1.txt");
sr.CurrentEncoding //·µ»Ø±àÂë
ÊÀ½çÉϵĸ÷µØÇø¶¼Óб¾µØµÄÓïÑÔ¡£µØÇø²îÒìÖ±½Óµ¼ÖÂÁËÓïÑÔ»·¾³µÄ²îÒì¡£ÔÚ¿ª·¢Ò»¸ö¹ú¼Ê»¯³ÌÐòµÄ¹ý³ÌÖУ¬´¦ÀíÓïÑÔÎÊÌâ¾ÍÏԵúÜÖØÒªÁË¡£
¡¡¡¡ÕâÊÇÒ»¸öÊÀ½ç·¶Î§ÄÚ¶¼´æÔÚµÄÎÊÌ⣬ËùÒÔ£¬Java
ÌṩÁËÊÀ½çÐԵĽâ¾ö·½·¨¡£±¾ÎÄÃèÊöµÄ·½·¨ÊÇÓÃÓÚ´¦ÀíÖÐÎĵģ¬µ«ÊÇ£¬Íƶø¹ãÖ®£¬¶ÔÓÚ´¦ÀíÊÀ½çÉÏÆäËü¹ú¼ÒºÍµØÇøµÄÓïÑÔͬÑùÊÊÓá£
¡¡¡¡ºº×ÖÊÇË«×ֽڵġ£Ëùν˫×Ö½ÚÊÇÖ¸Ò»¸öË«×ÖÒªÕ¼ÓÃÁ½¸öBYTEµÄλÖ㨼´16룩£¬·Ö±ð³ÆΪ¸ßλºÍµÍλ¡£Öйú¹æ¶¨µÄºº×Ö±àÂëΪGB2312£¬Õâ
ÊÇÇ¿ÖÆÐԵģ¬Ä¿Ç°¼¸ºõËùÓеÄÄÜ´¦ÀíÖÐÎĵÄÓ¦ÓóÌÐò¶¼Ö§³ÖGB2312¡£GB2312°üÀ¨ÁËÒ»¶þ¼¶ºº×ÖºÍ9Çø·ûºÅ£¬¸ßλ´Ó0xa1µ½0xfe£¬µÍλҲÊÇ´Ó
0xa1µ½0xfe£¬ÆäÖУ¬ºº×ֵıàÂ뷶ΧΪ0xb0a1µ½0xf7fe¡£
¡¡¡¡ÁíÍâÓÐÒ»ÖÖ±àÂ룬½Ð×öGBK£¬µ«ÕâÊÇÒ»·Ý¹æ·¶£¬²»ÊÇÇ¿ÖƵġ£GBKÌṩÁË20902¸öºº×Ö£¬Ëü¼æÈÝGB2312£¬±àÂ뷶ΧΪ0x8140µ½0xfefe¡£GBKÖеÄËùÓÐ×Ö·û¶¼¿ÉÒÔÒ»Ò»Ó³Éäµ½Unicode 2.0¡£
¡¡¡¡ÔÚ²»¾ÃµÄ½«À´£¬Öйú»á°ä²¼ÁíÒ»ÖÖ±ê×¼£ºGB18030-2000£¨GBK2K£©¡£ËüÊÕ¼Á˲ء¢ÃɵÈÉÙÊýÃñ×åµÄ×ÖÐÍ£¬´Ó¸ù±¾ÉϽâ¾öÁË×Öλ²»×ãµÄ
ÎÊÌâ¡£×¢Ò⣺Ëü²»ÔÙÊǶ¨³¤µÄ¡£Æä¶þ×Ö½Ú²¿·ÝÓëGBK¼æÈÝ£¬ËÄ×Ö½Ú²¿·ÖÊÇÀ©³äµÄ×Ö·û¡¢×ÖÐΡ£ËüµÄÊ××ֽں͵ÚÈý×Ö½Ú´Ó0x81µ½0xfe£¬¶þ×ֽں͵ÚËÄ×Ö½Ú´Ó
0x30µ½0x39¡£
¡¡¡¡±¾ÎIJ»´òËã½éÉÜUnicode£¬ÓÐÐËȤµÄ¿ÉÒÔä¯ÀÀ“http://www.unicode.org/”²é¿´¸ü¶àµÄÐÅÏ¢¡£UnicodeÓÐÒ»¸öÌØÐÔ£ºËü°üÀ¨ÁËÊÀ½çÉÏËùÓеÄ×Ö·û×ÖÐΡ£ËùÒÔ£¬¸÷¸öµØÇøµÄÓïÑÔ¶¼¿ÉÒÔ½¨Á¢ÓëUnicodeµÄÓ³Éä¹Øϵ£¬¶øJava
ÕýÊÇÀûÓÃÁËÕâÒ»µãÒÔ´ïµ½ÒìÖÖÓïÑÔÖ®¼äµÄת»»¡£
¡¡¡¡ÔÚJDKÖУ¬ÓëÖÐÎÄÏà¹ØµÄ±àÂëÓУº
¡¡¡¡±í1¡¡JDKÖÐÓëÖÐÎÄÏà¹ØµÄ±àÂëÁбí
±àÂëÃû³Æ ˵Ã÷
ASCII 7룬Óëascii7Ïàͬ
ISO8859-1 8-룬Óë 8859_1,ISO-8859-1,ISO_8859-1,latin1...µÈÏàͬ
GB2312-80 16룬Óëgb2312,gb2312-1980,EUC_CN,euccn,1381,Cp1381, 1383, Cp1383, ISO2022CN,ISO2022CN_GB...µÈÏàͬ
GBK ÓëMS936Ïàͬ£¬×¢Ò⣺Çø·Ö´óСд
UTF8 ÓëUTF-8Ïàͬ
GB18030 Óëcp1392¡¢1392Ïàͬ£¬Ä¿Ç°Ö§³ÖµÄJDKºÜÉÙ
¡¡¡¡ÔÚʵ¼Ê±à³Ìʱ£¬½Ó´¥µÃ±È½Ï¶àµÄÊÇGB2312£¨GBK£©ºÍISO8859-1¡£
¡¡¡¡ÎªÊ²Ã´»áÓГ?”ºÅ
¡¡¡¡ÉÏÎÄ˵¹ý£¬ÒìÖÖÓïÑÔÖ®¼äµÄת»»ÊÇͨ¹ýUni
Ïà¹ØÎĵµ£º
JAVA¿ª·¢Õß×ȥµÄ20¸öÓ¢ÎÄÍøÕ¾
1.[http://www.javaalmanac.com] – Java¿ª·¢ÕßÄê¼øÒ»ÊéµÄÔÚÏß°æ±¾. ÒªÏë¿ìËٲ鵽ijÖÖJava¼¼ÇɵÄÓ÷¨¼°Ê¾Àý´úÂë, ÕâÊÇÒ»¸ö²»´íµÄÈ¥´¦.
2.[http://www.onjava.com] – O’ReillyµÄJavaÍøÕ¾. ÿÖܶ¼ÓÐÐÂÎÄÕÂ.
3.[http://java.sun.com] – ¹Ù·½µÄJava¿ª·¢ÕßÍøÕ ......
1.Ï̴߳´½¨µÄÁ½ÖÖ·½Ê½
1£©À©Õ¹ThreadÀಢÖØдpublic void run()·½·¨
ps£º
¶¨ÒåỊ̈߳º
class myThread extends Thread(){
public void run(){
System.out.println("Ju ......
×ܽáÒ»£º
Java IOµÄÒ»°ãʹÓÃÔÔò£º
Ò»¡¢°´Êý¾ÝÀ´Ô´£¨È¥Ïò£©·ÖÀࣺ
1¡¢ÊÇÎļþ£º FileInputStream, FileOutputStream, FileReader, FileWriter
2¡¢ÊÇbyte[]£ºByteArrayInputStream, ByteArrayOutputStream
3¡¢ÊÇChar[]: CharArrayReader, CharArrayWriter
4¡¢ÊÇString: StringBufferInputStream, StringReader, StringW ......
ÎÒÃǶ¼ÖªµÀÔÚjspÖÐincludeÓÐÁ½ÖÖÐÎʽ,·Ö±ðÊÇ
< %@ include file=” ”%>
< jsp:include page=” ” flush=”true”/>
¡¡¡¡Ç°ÕßÊÇÖ¸ÁîÔªËØ¡¢ºóÕßÊÇÐÐΪԪËØ¡£¾ßÌåËüÃǽ«Ôںδ¦Óã¿ÈçºÎÓü°ËüÃÇÓÐʲôÇø±ð£¿ÕâÓ¦¸ÃÊǺܶàÈË¿´µ½Ëü¶¼»áÏëµ½µÄÎÊÌâ¡£ÏÂÃæÒ»ÆðÀ´¿´¿´°É¡£
¡¡¡ ......
°´Õսű¾ÓïÑÔÊÇ·þÎñÓÚijһ¸ö×ÓϵͳµÄÓïÑÔÕâÖÖÂÛÊö£¬ JSPÓ¦µ±±»¿´×÷ÊÇÒ»Öֽű¾ÓïÑÔ£¬È»¶ø£¬×÷ΪһÖֽű¾ÓïÑÔ£¬ JSPÓÖÏԵùýÓÚÇ¿´óÁË£¬ÔÚJSPÖм¸ºõ¿ÉÒÔʹÓÃÈ«²¿µÄJavaÀà¡£
×÷ΪһÖÖ»ùÓÚÎı¾µÄ¡¢ÒÔÏÔʾΪÖÐÐĵĿª·¢¼¼Êõ£¬JSPÌṩÁËJava Servlet µÄËùÓкô¦£¬²¢ÇÒ£¬µ±ÓëÒ»¸öJavaBeans Àà½áºÏÔÚÒ»Æðʱ£¬ÌṩÁËÒ»ÖÖʹÄÚÈ ......