linuxʹÓÃmvnÂÒÂëÔõô½â¾ö
linuxʹÓÃmvnÂÒÂëµÄ½â¾öÒªÁìÊÇ£º1¡¢ÔÚÖÕ¶ËÊäÈë¡°echo $lang¡±À´Éó²éÄ¿½ñϵͳµÄÓïÑÔÉèÖÃÊÇ·ñÆ¥ÅäÓû§ÕýÔÚʹÓõÄÓïÑÔ£»2¡¢ÊµÑéÐ޸ġ°~/.bashrc¡±Îļþ»ò¡°~/.profile¡±Îļþ£»3¡¢ÊµÑéʹÓÃutf-8×Ö·û¼¯£»4¡¢¼ì²éϵͳװÖõÄ×ÖÌåÊÇ·ñÄܹ»×¼È·µØ·ºÆð·Çascii×Ö·û£»5¡¢ÊµÑéÔÚmvnÏÂÁîºóÌí¼Ó¡°-dfile.encoding=utf-8¡±²ÎÊýÀ´Ç¿ÖÆÉèÖñàÂëΪu
±¾½Ì³Ì²Ù×÷ϵͳ£ºLinux5.18.14ϵͳ¡¢Dell G3µçÄÔ¡£
µ±ÔÚLinuxÖÐʹÓÃMavenʱ£¬·ºÆðÂÒÂëµÄÔµ¹ÊÔÓÉ¿ÉÄÜÊÇÓÉÓÚϵͳ±àÂëÉèÖò»Æ¥ÅäËùÒýÆðµÄ¡£Õâ¿ÉÄÜÓëÔÚÄúµÄϵͳÉÏʹÓõÄÍâµØÓïÑÔÉèÖá¢×ÖÌåºÍÖÕ¶ËÄ£ÄâÆ÷Óйء£
ΪÏàʶ¾öÕâ¸öÎÊÌ⣬Äã¿ÉÒÔʵÑéÒÔÏ°취£º
1¡¢Í¨¹ýÔÚÖÕ¶ËÊäÈë`echo $LANG`À´Éó²éÄ¿½ñϵͳµÄÓïÑÔÉèÖÃÊÇ·ñ׼ȷ£¬²¢È·±£ËüÆ¥ÅäÄúÕýÔÚʹÓõÄÓïÑÔ¡£
2¡¢ÊµÑéÐÞ¸Ä`~/.bashrc`Îļþ»ò`~/.profile`Îļþ£¬¼ÓÈëÒ»ÏÂÁ½ÐдúÂ룺
``` export LC_CTYPE=en_US.UTF-8 export.UTF-8 ```
µÇ¼ºó¸´ÖÆ
3¡¢ÈôÊÇÄãÕýÔÚʹÓõÄÖÕ¶ËÄ£ÄâÆ÷Ö§³ÖUnicode×Ö·û¼¯£¬ÇëʵÑéʹÓÃUTF-8×Ö·û¼¯£¬ÓÉÓÚUTF-8Ö§³ÖËùÓÐUnicode×Ö·û¼¯ÖеÄ×Ö·û¡£
4¡¢ÈôÊÇÄãʵÑéÒÔÉÏ°ì·¨µ«ÈÔÎÞ·¨½â¾öÎÊÌ⣬ÔòÐèÒª¼ì²éϵͳװÖõÄ×ÖÌåÊÇ·ñÄܹ»×¼È·µØ·ºÆð·ÇASCII×Ö·û¡£ÈôÊÇÐèÒª£¬Äú¿ÉÒÔÏÂÔز¢×°ÖÃÊʺÏÄúÓïÑÔµÄ×ÖÌå¡£
5¡¢×îºó£¬Äú¿ÉÒÔʵÑéÔÚmvnÏÂÁîºóÌí¼Ó`-Dfile.encoding=UTF-8`²ÎÊýÀ´Ç¿ÖÆÉèÖñàÂëΪUTF-8£¬ÒÔ±ã׼ȷ´¦Öóͷ£·ÇASCII×Ö·û¡£
×ÜÖ®£¬Òª½â¾öÔÚLinuxÖÐʹÓÃMaven·ºÆðÂÒÂëµÄÎÊÌ⣬ÄúÐèÒª¼ì²éϵͳµÄ±àÂëÉèÖá¢ÖÕ¶ËÄ£ÄâÆ÷µÄÖ§³Ö¡¢×ÖÌåµÈÒòËØ£¬²¢Æ¾Ö¤ÐèÒª½ÓÄÉÊʵ±µÄ²½·¥À´¸ü¸Ä±àÂëÉèÖá£
ÒÔÉϾÍÊÇlinuxʹÓÃmvnÂÒÂëÔõô½â¾öµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡