隨筆 - 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 閱讀(181) 評論(0)  編輯  收藏


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


          網站導航:
           
          主站蜘蛛池模板: 宁夏| 罗平县| 新津县| 盐山县| 新疆| 麦盖提县| 门源| 长宁区| 和田县| 达拉特旗| 休宁县| 许昌市| 临清市| 寻乌县| 万安县| 南康市| 林口县| 内黄县| 泗水县| 榆社县| 柏乡县| 陇西县| 清涧县| 云安县| 鸡西市| 湟中县| 仙桃市| 塔河县| 色达县| 依兰县| 澄城县| 亚东县| 平遥县| 民权县| 五家渠市| 常州市| 乐陵市| 潢川县| 和平县| 康马县| 湾仔区|