隨筆 - 53, 文章 - 0, 評論 - 3, 引用 - 0
          數據加載中……

          Trouble caused by un-visible blank character

          There are a few cases in which the un-visible blank character will cause
          problem, but it is hard to detect since they are not visible.

          One famous case is the '\t' character used by Make file, it is used to mark
          the start of a command. If it is replace by blank space character, it does
          not work, but you can not see the difference if you only look at the make file.
          This kind of problem may get the newbies crazy.

          Last week, I have encounter a similar issue, which is also caused by unnecessary
           blank space.
           
          As you may know, '\' is used as line-continuation when you have a very long line, e.g.
          when you configure the class path for Java in a property file, you may have something like this.

          classpath=/lib/A.jar;/lib/B.jar;\
          /lib/C.jar;/lib/D.jar;\
          /lib/E.jar;/lib/log4j.jar;\
          /lib/F.jar;/lib/httpclient.jar;

          But if you add extra blank space after the '\', then you can not get the complete
          content of classpath. Because only when '\' is followed by a '\n' on Unix or '\r''\n'
          on Windows, it will work as line-continuation ; otherwise, e.g '\' is followed by
          ' ''\n', the line is complete after the '\n', the content after that will be the start of
          a new line.

          Fortunately, it is easy to check this kind of extra blank space by using vi in Unix.
          use command '$' to go to the end of line, if there is no extra blank space after '\',
          the current position should be '\', if there are any blank space after '\', the current position
          is after the '\'.
           

          posted on 2009-07-01 11:48 InPractice 閱讀(180) 評論(0)  編輯  收藏


          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 合山市| 通道| 文昌市| 沙湾县| 蓬安县| 深水埗区| 洪江市| 阿巴嘎旗| 福建省| 聂拉木县| 襄汾县| 潍坊市| 峡江县| 商城县| 招远市| 文登市| 丹江口市| 方城县| 崇义县| 永清县| 贞丰县| 乐昌市| 盘山县| 噶尔县| 大庆市| 永仁县| 新昌县| 望都县| 石泉县| 蚌埠市| 北海市| 都安| 铜鼓县| 松潘县| 西城区| 沁水县| 东港市| 蛟河市| 沛县| 崇礼县| 涿州市|