IETFµÄRFC2781ºÍRFC3629ÒÔRFCµÄÒ»¹á·ç¸ñ£¬ÇåÎú¡¢Ã÷¿ìÓÖ²»Ê§ÑϽ÷µØÃèÊöÁËUTF-16ºÍUTF-8µÄ±àÂë·½·¨¡£ÎÒ×ÜÊǼDz»µÃ IETFÊÇInternet Engineering Task ForceµÄËõд¡£µ«IETF¸ºÔðά»¤µÄRFCÊÇInternetÉÏÒ»Çй淶µÄ»ù´¡¡£
2.1¡¢ÄÚÂëºÍcode page
Ä¿Ç°WindowsµÄÄÚºËÒѾ֧³ÖUnicode×Ö·û¼¯£¬ÕâÑùÔÚÄÚºËÉÏ¿ÉÒÔÖ§³ÖÈ«ÊÀ½çËùÓеÄÓïÑÔÎÄ×Ö¡£µ«ÊÇÓÉÓÚÏÖÓеĴóÁ¿³ÌÐòºÍÎĵµ¶¼²ÉÓÃÁËijÖÖÌض¨ÓïÑԵıàÂ룬ÀýÈçGBK£¬Windows²»¿ÉÄܲ»Ö§³ÖÏÖÓеıàÂ룬¶øÈ«²¿¸ÄÓÃUnicode¡£
WindowsʹÓôúÂëÒ³(code page)À´ÊÊÓ¦¸÷¸ö¹ú¼ÒºÍµØÇø¡£code page¿ÉÒÔ±»Àí½âΪǰÃæÌáµ½µÄÄÚÂë¡£GBK¶ÔÓ¦µÄcode pageÊÇCP936¡£
΢ÈíҲΪGB18030¶¨ÒåÁËcode page£ºCP54936¡£µ«ÊÇÓÉÓÚGB18030ÓÐÒ»²¿·Ö4×Ö½Ú±àÂ룬¶øWindowsµÄ´úÂëÒ³Ö»Ö§³Öµ¥×Ö½ÚºÍË«×Ö½Ú±àÂ룬ËùÒÔÕâ¸öcode pageÊÇÎÞ·¨ÕæÕýʹÓõġ£
3¡¢UCS-2¡¢UCS-4¡¢BMP
UCSÓÐÁ½ÖÖ¸ñʽ£ºUCS-2ºÍUCS-4¡£¹ËÃû˼Ò壬UCS-2¾ÍÊÇÓÃÁ½¸ö×Ö½Ú±àÂ룬UCS-4¾ÍÊÇÓÃ4¸ö×Ö½Ú£¨Êµ¼ÊÉÏÖ»ÓÃÁË31룬×î¸ßλ±ØÐëΪ0£©±àÂë¡£ÏÂÃæÈÃÎÒÃÇ×öһЩ¼òµ¥µÄÊýѧÓÎÏ·£º
UCS-2ÓÐ2^16=65536¸öÂë룬UCS-4ÓÐ2^31=2147483648¸öÂëλ¡£
UCS-4¸ù¾Ý×î¸ßλΪ0µÄ×î¸ß×Ö½Ú·Ö³É2^7=128¸ögroup¡£Ã¿¸ögroupÔÙ¸ù¾Ý´Î¸ß×Ö½Ú·ÖΪ256¸öplane¡£Ã¿¸öplane¸ù¾ÝµÚ 3¸ö×Ö½Ú·ÖΪ256ÐÐ (rows)£¬Ã¿Ðаüº¬256¸öcells¡£µ±È»Í¬Ò»ÐеÄcellsÖ»ÊÇ×îºóÒ»¸ö×Ö½Ú²»Í¬£¬ÆäÓ඼Ïàͬ¡£
group 0µÄplane 0±»³Æ×÷Basic Multilingual Plane, ¼´BMP¡£»òÕß˵UCS-4ÖУ¬¸ßÁ½¸ö×Ö½ÚΪ0µÄÂëλ±»³Æ×÷BMP¡£
½«UCS-4µÄBMPÈ¥µôÇ°ÃæµÄÁ½¸öÁã×ֽھ͵õ½ÁËUCS-2¡£ÔÚUCS-2µÄÁ½¸ö×Ö½ÚÇ°¼ÓÉÏÁ½¸öÁã×Ö½Ú£¬¾ÍµÃµ½ÁËUCS-4µÄBMP¡£¶øÄ¿Ç°µÄUCS-4¹æ·¶Öл¹Ã»ÓÐÈκÎ×Ö·û±»·ÖÅäÔÚBMPÖ®Íâ¡£
4¡¢UTF±àÂë
UTF-8¾ÍÊÇÒÔ8λΪµ¥Ôª¶ÔUCS½øÐбàÂë¡£´ÓUCS-2µ½UTF-8µÄ±àÂ뷽ʽÈçÏ£º
UCS-2±àÂë(16½øÖÆ) UTF-8 ×Ö½ÚÁ÷(¶þ½øÖÆ)
0000 - 007F 0xxxxxxx
0080 - 07FF 110xxxxx 10xxxxxx
0800 - FFFF 1110xxxx 10xxxxxx 10xxxxxx
ÀýÈ瓺º”×ÖµÄUnicode±àÂëÊÇ6C49¡£6C49ÔÚ0800-FFFFÖ®¼ä£¬ËùÒԿ϶¨ÒªÓÃ3×Ö½ÚÄ£°åÁË£º1110xxxx 10xxxxxx10xxxxxx¡£½«6C49д³É¶þ½øÖÆÊÇ£º0110 110001 001001£¬ ÓÃÕâ¸ö±ÈÌØÁ÷ÒÀ´Î´úÌæÄ£°åÖеÄx£¬µÃµ½£º1110011010110001 10001001£¬¼´E6 B1 89¡£
¶ÁÕß¿ÉÒÔÓüÇʱ¾²âÊÔÒ»ÏÂÎÒÃǵıàÂëÊÇ·ñÕýÈ·¡£ÐèҪעÒ⣬UltraEditÔÚ´ò¿ªutf-8±àÂëµÄÎı¾Îļþʱ»á×Ô¶¯×ª»»ÎªUTF-16£¬¿ÉÄܲúÉú»ìÏý¡£Äã¿ÉÒÔÔÚÉèÖÃÖйصôÕâ¸öÑ¡Ïî¡£¸üºÃµÄ¹¤¾ßÊÇHex Workshop¡£