java×Ö·û´®µÄ¸÷ÖÖ±àÂëת»»
import java.io.UnsupportedEncodingException;
/**
* ת»»×Ö·û´®µÄ±àÂë
*/
public class ChangeCharset {
/** 7λASCII×Ö·û£¬Ò²½Ð×÷ISO646-US¡¢Unicode×Ö·û¼¯µÄ»ù±¾À¶¡¿é */
public static final String US_ASCII = "US-ASCII";
/** ISO À¶¡×Öĸ±í No.1£¬Ò²½Ð×÷ ISO-LATIN-1 */
public static final String ISO_8859_1 = "ISO-8859-1";
/** 8 λ UCS ת»»¸ñʽ */
public static final String UTF_8 = "UTF-8";
/** 16 λ UCS ת»»¸ñʽ£¬Big Endian£¨×îµÍµØÖ·´æ·Å¸ßλ×Ö½Ú£©×Ö½Ú˳Ðò */
public static final String UTF_16BE = "UTF-16BE";
/** 16 λ UCS ת»»¸ñʽ£¬Little-endian£¨×î¸ßµØÖ·´æ·ÅµÍλ×Ö½Ú£©×Ö½Ú˳Ðò */
public static final String UTF_16LE = "UTF-16LE";
/** 16 λ UCS ת»»¸ñʽ£¬×Ö½Ú˳ÐòÓÉ¿ÉÑ¡µÄ×Ö½Ú˳Ðò±ê¼ÇÀ´±êʶ */
public static final String UTF_16 = "UTF-16";
/** ÖÐÎij¬´ó×Ö·û¼¯ */
public static final String GBK = "GBK";
/**
* ½«×Ö·û±àÂëת»»³ÉUS-ASCIIÂë
*/
public String toASCII(String str) throws UnsupportedEncodingException{
return this.changeCharset(str, US_ASCII);
}
/**
* ½«×Ö·û±àÂëת»»³ÉISO-8859-1Âë
*/
public String toISO_8859_1(String str) throws UnsupportedEncodingException{
return this.changeCharset(str, ISO_8859_1);
}
/**
* ½«×Ö·û±àÂëת»»³ÉUTF-8Âë
*/
public String toUTF_8(String str) throws UnsupportedEncodingException{
return this.changeCharset(str, UTF_8);
}
/**
* ½«×Ö·û±àÂëת»»³ÉUTF-16BEÂë
*/
public String toUTF_16BE(String str) throws UnsupportedEncodingException{
return this.changeCharset(str, UTF_16BE);
}
/**
* ½«×Ö·û±àÂëת»»³ÉUTF-16LEÂë
*/
public String toUTF_16LE(String str) throws UnsupportedEncodingException{
return this.changeCharset(str, UTF_16LE);
}
/**
* ½«×Ö·û±àÂëת»»³ÉUTF-16Âë
*/
public String toUTF_16(String str) throws UnsupportedEncodingException{
return this.changeCharset(str, UTF_16);
}
/**
* ½«×Ö·û±àÂëת»»³ÉGBKÂë
*/
public String toGBK(String str) throws UnsupportedEncodingException{
return this.changeCharset(str, GBK);
}
Ïà¹ØÎĵµ£º
ÔÚÎÒÃÇд³ÌÐòµÄʱºò,ÓÐʱ»áÒªÇó±£´æÒ»Ð©Êý¾Ý,±ÈÈçÓû§Ãû»òÕß±ðµÄ,µ«ÊÇÕâÑùÊý¾ÝÓÖ²»ÊDZ£´æÔÚ³ÌÐòͬһĿ¼ÏÂ,ÕâÑù×öÌ«Ã÷ÏÔÁË,Ò²²»Ì«°²È«,ÄÇÔõô°ìÄØ?Õâ¸öʱºò,Èç¹ûÄܰÑÊý¾Ý±£´æµ½×¢²á±íÀïÃæÈ¥,ÄǸöàºÃ,Ò»À´Òþ±Î,¶þÀ´·½±ã,²»ÖÁÓÚÔÚ³ÌÐòĿ¼ÏÂÉú³ÉÒ»´óƬÎļþ.
ÔÚJAVAÀïÃæ,¿ÉÒÔÀûÓÃjava.util.prefs.PreferencesÀ´¶Ô×¢²á±í½øÐ ......
javaÖеÄʱ¼ä²Ù×÷²»ÍâºõÕâËÄÖÖÇé¿ö£º
1¡¢»ñÈ¡µ±Ç°Ê±¼ä
2¡¢»ñȡij¸öʱ¼äµÄijÖÖ¸ñʽ
3¡¢ÉèÖÃʱ¼ä
4¡¢Ê±¼äµÄÔËËã
ºÃ£¬ÏÂÃæ¾ÍÕë¶ÔÕâËÄÖÖÇé¿ö£¬Ò»¸öÒ»¸ö¸ã¶¨¡£
Ò»¡¢»ñÈ¡µ±Ç°Ê±¼ä
ÓÐÁ½ÖÖ·½Ê½¿ÉÒÔ»ñµÃ£¬µÚÒ»ÖÖ£¬Ê¹ÓÃDateÀà¡£
j2SEµÄ°üÀïÓÐÁ½¸öDateÀ࣬һ¸öÊÇjava.sql.Date,Ò»¸öÊÇjava.util.Date
ÕâÀҪʹÓÃjava.util. ......
£¨1£©Ctrl+M ££Çл»´°¿ÚµÄ´óС
£¨2£©Ctrl+Q ££Ìøµ½×îºóÒ»´ÎµÄ±à¼´¦
£¨3£©F2 ££µ±Êó±ê·ÅÔÚÒ»¸ö±ê¼Ç´¦³öÏÖTooltipʱºò°´F2Ôò°ÑÊó±êÒÆ¿ªÊ±Tooltip»¹»áÏÔʾ¼´Show Tooltip Description¡£
F3   ......
³ÌÐòÖ´ÐÐʱ»á˳Ðò¾¹ýloading¡¢linking¡¢initializationÈý¸ö²½Öè
1. loading£º²éÕÒÀà»ò½Ó¿ÚµÄ¶þ½øÖÆÎļþ
2. linking£º×°ÈëÀà»ò½Ó¿ÚµÄ¶þ½øÖÆÎļþ£¬ºÏΪJVMµÄÔËÐÐ״̬£¬Ê¹Æä¿ÉÒÔ±»Ö´ÐС£´Ë¹ý³Ì°üÀ¨Èý¸ö×Ó¹ý³Ì£ºverification, preparation, and
resolution of symbolic references
3. initialization£º ......
¶¨ÒåÒ»¸önative ·½·¨£º
package ext;
import java.util.Hashtable;
public class TestJNI
{
static
{
System.loadLibrary("dllfile");
}
public TestJNI()
{
......