Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

javaÓëC++ÖÐÎÄ×Ö·ûµÄÎÊÌâ

 
ÖÐÎĵıàÂë³£ÓõÄÓÐ3ÖÖ¸ñʽ£º1£©gb2312(¾ÍÊÇasciiÂ뷽ʽ£¬Ò²Ëµansi) 2)unicode 3)utf-8
c++Ò»°ã²ÉÓÃanciiÂ룬¶øjavaÒ»°ã²ÉÓÃunicode£¬¶øSymbianC++£¨ÒÔºó¼ò³Æsymbian£©²ÉÓÃunicode»òutf-8
±ÈÈ纺×Ö“ºÃ”£º unicodeΪ“7D 59”£¬¶øasciiΪ“BA C3”, utf-8±àÂëΪ3¸ö×Ö½Ú¡£
ÖÕ¶ËÄã¿ÉÒÔÑ¡ÔñʹÓÃchar *, unsigned char *, µ«ÊÇÕâ²»ÊÇÍÆ¼öʹÓõģ¬ºÜ¶àʱºò´¦ÀíµÄʱºòÈç½çÃæµÈÐèҪת»¯ÎªÖն˵Ä×Ö·û±àÂë¸ñʽ¡£
ÏÖÔÚ·Ö4²¿·Ö½²½â×Ö·û±àÂëת»¯£¨Àý×Ó¼ÙÉ裬javaºÍsymbian¼ä²ÉÓÃutf-8£¬c++ºÍsymbianÖ®¼ä²ÉÓÃASCIIÂ룩£º
1) Symbian -> Java ·¢Ëͺ¬ÓÐÖÐÎĵÄÏûÏ¢  
   ÎÒÃǼÙÉèÄãµÄSymbianµÄ·¢ËÍÏûÏ¢µÄ½Ó¿Ú²ÉÓõÄÊÇHBufC8 * (utf-8)
   ÄÇôÄãÔÚ·¢ËÍÄãµÄÏûϢ֮ǰ£¬ÐèÒª½«Êý¾Ýת»¯Îªutf-8¸ñʽ£¬
   ÀýÈ磬Äã¿ÉÒÔʹÓÃCnvUtfConverter::ConvertfromUnicodeToUtf8()½«½çÃæµÄTBufת»¯Îª8λµÄutf-8¸ñʽ£¬×ª»¯¹ý³ÌÖÐÄãÒªÓÈÆä×¢Ò⣬ΪHBufC8 * ¿ª±ÙµÄÄÚ´æÓ¦¸ÃÊÇTBuf³¤¶ÈµÄ2±¶!
  
ÖÁÓÚÖÕ¶ËÈçºÎ´¦ÀíJava¶Ë·¢Ë͵ÄÏûÏ¢¾Í²»ÑÔ¶øÓ÷ÁË£¬Javaͨ³£»áÖ»·¢ËÍÒ»¸öString,
Ò²¾ÍÊÇÒ»¸öUnicode×Ö·û´®£¬Õâ¸öʱºòÒ»°ãSymbian»áÒÔTDes8½ÓÊÕ£¬Êµ¼ÊÉϽÓÊÕµÄÊý¾ÝÊÇUnicodeµÄ¶ø²»ÊÇutf-8µÄ£¬µ«ÊÇ
SymbianÖ§³ÖÕâÖÖ¸ñʽ£¬ËùÒÔ¿ÉÒÔÖ±½Ó¾Í°´ÕâÖÖ·½Ê½´¦Àí£¬¶ø²»ÐèҪת»¯¡£µ±È»£¬ÒªÔÚ½çÃæÉÏÏÔʾµÄ»°»¹ÊÇÐèÒªCnvUtfConverter::
ConvertToUnicodefromUtf8())  
2) Java -> Symbian ·¢Ëͺ¬ÓÐÖÐÎĵÄÏûÏ¢
   ·þÎñÆ÷¶Ë
µ±È»Ò²Òª´¦ÀíÖÐÎÄÁË£¬¸Õ²ÅÒѾ­ËµÁË£¬·¢Ë͵ÄʱºòÄã¿ÉÒÔÖ±½Ó·¢ËÍString
(Unicode)£¬ÈÃSymbianÈ¥½âÎö£¬µ«ÊǽÓÊվ͵ÃÊ®·ÖСÐÄ£¡£¡ÖÕ¶ËSymbian¹ýÀ´µÄÊÇHBufC8*
(utf-8)¸ñʽ£¬JavaÇмɲ»ÒªÖ±½ÓÓÃStringÈ¥½ÓÊÕ£¬ÐèÒª°´×Ö½Ú½ÓÊÕ£¬È»ºóÔÙ½«ÕâЩ×Ö½Ú½âÎö³Éutf-8,ÔÙת»¯ÎªString,Óм¸Ìõ¼òµ¥
µÄÓï¾ä¿ÉÒÔÍê³ÉÕâ¸ö²Ù×÷£º
   byte b3[] £½ ...; //À´×ÔSymbianµÄutf-8×Ö½Ú
   DataInputStream dis=new DataInputStream(new ByteArrayInputStream(b3));
   String chinastring = dis.readUTF();
3) Symbian -> C++ ·¢Ëͺ¬ÓÐÖÐÎĵÄÏûÏ¢
   ÏÖÔÚÎÒÃÇÔÙÀ´ÌÖÂÛÏ£¬ÈçºÎ½«SymbianµÄÏûÏ¢·¢Ë͸øC++×ÓÏµÍ³ÄØ£¬ ÏÔÈ»£¬C++×ÓϵͳÊǰ´ÕÕchar */unsigned char *´¦Àí×Ö·û´®µÄ£¬Ò²¾ÍÊÇASCIIÂ뷽ʽ£¨ÖÐÎľÍÊÇÀ©Õ¹µÄANSI¼´GB2312£


Ïà¹ØÎĵµ£º

Java NIO APIÏê½â

 
Java NIO APIÏê½â
ÔÚJDK
1.4ÒÔǰ£¬JavaµÄIO²Ù×÷¼¯ÖÐÔÚjava.ioÕâ¸ö°üÖУ¬ÊÇ»ùÓÚÁ÷µÄ×èÈû£¨blocking£©API¡£¶ÔÓÚ´ó¶àÊýÓ¦ÓÃÀ´Ëµ£¬ÕâÑùµÄAPIʹÓúܷ½
±ã£¬È»¶ø£¬Ò»Ð©¶ÔÐÔÄÜÒªÇó½Ï¸ßµÄÓ¦Óã¬ÓÈÆäÊÇ·þÎñ¶ËÓ¦Óã¬ÍùÍùÐèÒªÒ»¸ö¸üΪÓÐЧµÄ·½Ê½À´´¦ÀíIO¡£´ÓJDK 1.4Æð£¬NIO
API×÷Ϊһ¸ö»ùÓÚ»º³åÇø£¬²¢ÄÜÌṩ·Ç×èÈû(non-blo ......

ÓÃJava¿ª·¢´úÀí·þÎñÆ÷

 
´úÀí·þÎñÆ÷µÄÓ¦Ó÷dz£¹ã·º¡£±ÈÈ磬ÔÚÆóÒµÍøÄÚ²¿£¬Ëü¿ÉÒÔÓÃÀ´¿ØÖÆÔ±¹¤ÔÚ¹¤×÷ʱä¯ÀÀµÄInternetÄÚÈÝ£¬×èÖ¹Ô±¹¤·ÃÎÊijЩÀàÐÍ
µÄÄÚÈÝ»òijЩָ¶¨µÄÍøÕ¾¡£´úÀí·þÎñÆ÷ʵ¼ÊÉϰçÑÝ×Åä¯ÀÀÆ÷ºÍWeb·þÎñÆ÷Ö®¼äµÄÖмäÈ˵ĽÇÉ«£¬Äܹ»¶Ôä¯ÀÀÆ÷ÇëÇó½øÐи÷ÖÖ¸÷ÑùµÄ´¦Àí£¬Äܹ»¹ýÂË¹ã¸æºÍ
Cookie£¬Äܹ»Ô¤ÏÈÌáÈ¡WebÒ³Ãæ£¬Ê¹µÃä¯ÀÀÆ÷·ÃÎÊ ......

[vb]ʹÓÃvbͳ¼Æ.javaµÄÐÐÊý

 ¹¤×÷ÐèÒª£¬Õë¶ÔjavaÎļþ£¬×÷ÁËÒ»¸öÐÐÊýͳ¼ÆµÄ¹¤¾ß¡£Í³¼ÆµÄÖ÷Òª´úÂëÈçÏ£º
    Set srcIn = fso.OpenTextFile(fileNm, ForReading)
    
    Do While Not srcIn.AtEndOfStream
        buf = srcIn.ReadLine
 &nbs ......

C/C++Ì⼯

ת×Ô£º http://hi.baidu.com/elliott_hdu/blog/item/411421dd5bf8dfe977c63876.html
1.ÏÂÁгÌÐòµÄÊä³ö½á¹ûΪ£º(B)
#include<iostream.h>
void main()
{
       char* a[ ] = { "hello", "the", "world"};
       char** pa = a;
 &nbs ......

C/C++Êý×éÃûÓëÖ¸ÕëÇø±ðÉîÈë̽Ë÷

ÒýÑÔ
¡¡¡¡Ö¸ÕëÊÇC/C++ÓïÑÔµÄÌØÉ«£¬¶øÊý×éÃûÓëÖ¸ÕëÓÐÌ«¶àµÄÏàËÆ£¬ÉõÖÁºÜ¶àʱºò£¬Êý×éÃû¿ÉÒÔ×÷ΪָÕëʹÓá£ÓÚÊǺõ£¬ºÜ¶à³ÌÐòÉè¼ÆÕ߾ͱ»¸ãºýÍ¿ÁË¡£¶øÐí¶àµÄ´óѧÀÏʦ£¬ËûÃÇÔÚCÓïÑԵĽÌѧ¹ý³ÌÖÐÒ²´íÎóµÃ¸øÑ§Éú½²½â£º"Êý×éÃû¾ÍÊÇÖ¸Õë"¡£ºÜÐÒÔË£¬ÎҵĴóѧÀÏʦ¾ÍÊÇÆäÖÐÖ®Ò»¡£Ê±ÖÁ½ñÈÕ£¬ÎÒÈÕ¸´Ò»ÈյؽøÐÐ×ÅC/C++ÏîÄ¿µÄ¿ª·¢£¬¶øÉí±ß» ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ