ÔÚLinux C±à³ÌÖÐʹÓÃUnicodeºÍUTF 8
Ä¿Ç°¸÷ÖÖLinux·¢Ðа涼֧³ÖUTF-8±àÂ룬µ±Ç°ÏµÍ³µÄÓïÑÔºÍ×Ö·û±àÂëÉèÖñ£´æÔÚһЩ»·¾³±äÁ¿ÖУ¬¿ÉÒÔͨ¹ýlocaleÃüÁî²é¿´£º
$ locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
³£Óúº×ÖÒ²¶¼Î»ÓÚBMPÖУ¬ËùÒÔÒ»¸öºº×ֵĴ洢ͨ³£Õ¼3¸ö×Ö½Ú¡£ÀýÈç±à¼Ò»¸öC³ÌÐò£º
#include <stdio.h>
int main(void)
{
printf("ÄãºÃ\n");
return 0;
}
Ô´ÎļþÊÇÒÔUTF-8±àÂë´æ´¢µÄ£º
$ od -tc nihao.c
0000000 # i n c l u d e < s t d i o .
0000020 h > \n \n i n t m a i n ( v o i
0000040 d ) \n { \n \t p r i n t f ( " 344 275
0000060 240 345 245 275 \ n " ) ; \n \t r e t u r
0000100 n 0 ; \n } \n
0000107
ÆäÖа˽øÖƵÄ344 375 240£¨Ê®Áù½øÖÆe4 bd a0£©¾ÍÊÇ“Ä㔵ÄUTF-8±àÂ룬°Ë½øÖƵÄ345 245 275£¨Ê®Áù½øÖÆe5 a5 bd£©¾ÍÊÇ“ºÃ”¡£°ÑËü±àÒë³ÉÄ¿±êÎļþ£¬"ÄãºÃ\n"Õâ¸ö×Ö·û´®¾Í³ÉÁËÕâÑùÒ»´®×Ö½Ú£ºe4 bd a0 e5 a5 bd 0a 00£¬ºº×ÖÔÚÆäÖÐÈÔÈ»ÊÇUTF-8±àÂëµÄ£¬Ò»¸öºº×ÖÕ¼3¸ö×Ö½Ú£¬ÕâÖÖ×Ö·ûÔÚCÓïÑÔÖгÆΪ¶à×Ö½Ú×Ö·û£¨Multibyte Character£©¡£ÔËÐÐÕâ¸ö³ÌÐòÏ൱ÓÚ°ÑÕâÒ»´®×Ö½Úwriteµ½µ±Ç°Öն˵ÄÉ豸Îļþ¡£Èç¹ûµ±Ç°Öն˵ÄÇý¶¯³ÌÐòÄܹ»Ê¶±ðUTF-8±àÂë¾ÍÄÜ´òÓ¡³öºº×Ö£¬Èç¹ûµ±Ç°Öն˵ÄÇý¶¯³ÌÐò²»ÄÜʶ±ðUTF-8±àÂ루±ÈÈçÒ»°ãµÄ×Ö·ûÖնˣ©¾Í´òÓ¡²»³öºº×Ö¡£Ò²¾ÍÊÇ˵£¬ÏñÕâÖÖ³ÌÐò£¬Ê¶±ðºº×ֵŤ×÷¼È²»ÊÇÓÉC±àÒëÆ÷×öµÄÒ²²»ÊÇÓÉlibc×öµÄ£¬C±àÒëÆ÷Ô·â²»¶¯µØ°ÑÔ´ÎļþÖеÄUTF-8±àÂ븴ÖƵ½Ä¿±êÎļþÖУ¬libcÖ»Êǵ±×÷ÒÔ0½áβµÄ×Ö·û´®Ô·â²»¶¯µØwrite¸øÄںˣ¬Ê¶±ðºº×ֵŤ×÷ÊÇÓÉÖն˵ÄÇý¶¯³ÌÐò×öµÄ¡£
µ«ÊǽöÓÐÕâÖ̶ֳȵĺº×ÖÖ§³ÖÊDz»¹»µÄ£¬ÓÐʱºòÎÒÃÇÐèÒªÔÚC³ÌÐòÖвÙ×÷×Ö·û´®ÀïµÄ×Ö·û£¬±ÈÈçÇó×Ö·û´®"ÄãºÃ\n"ÖÐÓм¸¸öºº×Ö»ò×Ö·û£¬ÓÃstrlen¾Í²»ÁéÁË£¬ÒòΪstrlenÖ»¿´½áβµÄ0×Ö½Ú¶ø²»¹Ü×Ö·û´®Àï´æµÄÊÇʲô£¬Çó³öÀ´µÄÊÇ×Ö½ÚÊý7¡£ÎªÁËÔÚ³ÌÐòÖвÙ×÷Unicode×Ö·û£¬CÓïÑÔ¶¨ÒåÁË¿í×Ö·û
Ïà¹ØÎĵµ£º
1. HCI²ãÐÒé¸ÅÊö£º
HCIÌṩһÌ×ͳһµÄ·½·¨À´·ÃÎÊBluetoothµ×²ã¡£ÈçͼËùʾ£º
´ÓͼÉÏ¿ÉÒÔ¿´³ö£¬Host Controller Interface(HCI) ¾ÍÊÇÓÃÀ´¹µÍ¨HostºÍModule¡£Hostͨ³£¾ÍÊÇPC£¬ ModuleÔòÊÇÒÔ¸÷ÖÖÎïÀíÁ¬½ÓÐÎʽ£¨USB,serial,pc-cardµÈ£©Á¬½Óµ½PCÉϵÄbluetooth Dongle¡£
ÔÚHostÕâÒ»¶Ë£ºapplication,SDP,L2capµÈÐÒé ......
1. ѧ»áд¼òµ¥µÄmakefile
2. ±àһЩӦÓÃ
³ÌÐò
£¬¿ÉÒÔÓÃmakefileÅÜÆðÀ´
3. ѧ»áдÇý¶¯
µÄmakefile
4. дһ¼òµ¥charÇý¶¯£¬makefile±àÒëͨ¹ý£¬¿ÉÒÔinsmod£¬ lsmod£¬ rmmod. ÔÚÇý¶¯µÄinitº¯ÊýÀï´òÓ¡hello world£¬insmodºóÓ¦¸ÃÄܹ»Í¨¹ýdmesg¿´µ½Êä³ö
¡£
5. дһÍêÕûÇý¶¯£¬ ¼ÓÉÏread£¬ write£¬ ioctl£¬ pollingµÈ¸ ......
ʹÓà Java ¶Ô Linux ÏÂÎļþ±àÂë¸ñʽ½øÐÐÅúÁ¿×ª»»
²âÊÔʹÓÃ˵Ã÷£º
1¡£½« ×Ö·û¼¯±àÂë¸ñʽΪ GB2312 µÄÎļþ test0.java£¬test1.java£¬test2.java ·ÅÔÚ /home/defonds/tmp/test Ŀ¼Ï£¨test0.java£¬test1.java£¬test2.java ×÷Õß¿ÉÒÔ ......
LINUX ÏÂVIÉèÖÃ
Ó¦ÓóÌÐòÆô¶¯Ê±£¬ÏȶÁÆäÅäÖÃÎļþ¡£Õâ¶ÔÓÚvi/vimÀ´Ëµ¾ÍÊǹ¤×÷Ŀ¼ÏµÄÒþ²ØÎļþ.vimrc¡£
¹ý³Ì(ÒÔrootÓû§ÎªÀý)
#vi ~/.vimrc
ÓÃÒÔÏÂÃüÁîд.vimrcÎļþΪ£º
&nb ......
Linux ϵͳ´¦ÓÚÕý³£×´Ì¬Ê±£¬·þÎñÆ÷Ö÷»ú¿ª»ú£¨»òÖØÐÂÆô¶¯£©ºó£¬Äܹ»ÓÉϵͳÒýµ¼Æ÷³ÌÐò×Ô¶¯Òýµ¼ Linux ϵͳÆô¶¯µ½¶àÓû§Ä£Ê½£¬²¢ÌṩÕý³£µÄÍøÂç·þÎñ¡£Èç¹ûϵͳ¹ÜÀíÔ±ÐèÒª½øÐÐϵͳά»¤»òϵͳ³öÏÖÆô¶¯Ò쳣ʱ£¬¾ÍÐèÒª½øÈëµ¥Óû§Ä£Ê½»òÐÞ¸´Ä£Ê½¶Ôϵͳ½øÐйÜÀíÁË¡£Ê¹Óõ¥Óû§Ä£Ê½ÓÐÒ»¸öÇ°Ìᣬ¾ÍÊÇÄúµÄϵͳÒýµ¼Æ÷£¨grub£©ÄÜÕý³£¹¤×÷£ ......