Sealyu

          --- 博客已遷移至: http://www.sealyu.com/blog

            BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理 ::
            618 隨筆 :: 87 文章 :: 225 評(píng)論 :: 0 Trackbacks
          One problem that has repeatedly cropped up when developing in Java is strange error messages in our unit tests for certain text manipulation tests when running on a freshly installed Ubuntu desktop.

          They are all related to Ubuntu's default British locale: en_GB.UTF-8

          This was causing files checked out of CVS to be in Unicode (UTF-8) format rather than ISO-8859-1 and so the British pound sign (£) was being encoded as a double-byte (rather than single-byte) character in the file.

          To check which locale you currently have as your default just run: locale

          Changing the default locale is a little different on Ubuntu compared to most Linux distros, these are the steps we needed to go through to get it changed:

          Add the locale to the list of 'supported locales'
          Edit /var/lib/locales/supported.d/local and add the following line:
          en_GB ISO-8859-1

          Regenerate the supported locales
          Run sudo dpkg-reconfigure locales

          Change the default locale
          Edit /etc/environment and ensure the LANG and LANGUAGE lines read as follows:
          LANG="en_GB"
          LANGUAGE="en_GB:en"


          UPDATE '09: An old collegue has suggested that this change should now be made in /etc/default/locale rather than /etc/environment - Thanks Guy!

          Reboot!

          Rerun locale to check that your default locale is now en_GB
          posted on 2010-05-22 00:16 seal 閱讀(630) 評(píng)論(0)  編輯  收藏 所屬分類: Linux
          主站蜘蛛池模板: 建始县| 舞阳县| 兴隆县| 乐平市| 甘德县| 新建县| 罗甸县| 棋牌| 金寨县| 察隅县| 石河子市| 竹山县| 德昌县| 新和县| 山丹县| 金坛市| 抚宁县| 伊宁县| 周至县| 乌什县| 清远市| 惠州市| 青阳县| 于田县| 平安县| 重庆市| 柯坪县| 遂昌县| 石林| 金湖县| 通江县| 阿克苏市| 蕲春县| 都匀市| 平乡县| 宽甸| 台中市| 塘沽区| 凌海市| 襄汾县| 东宁县|