Loading ...
Sorry, an error occurred while loading the content.

202RE: [NTS] Perl 5.8 vs. Notetab

Expand Messages
  • Grant MacKenzie
    Apr 7, 2003
      I am not sure about this but think this is a problem to do with the Byte
      Order Mark (BOM) used in unicode

      "in Perl 5.8 the Unicode model has completely changed: now the
      ``Unicodeness'' is bound to the data itself,"
      REF: perl documentation

      When using the WSH stdin stdOut i also ran into this so I do a regEx on the
      read stream.

      var stdin = WScript.StdIn;
      var stdout = WScript.StdOut;
      var inStr = stdin.ReadAll();
      inStr = inStr.replace(//g, " ");

      The box thing as I understand it a way MS deals with an unrecognised
      If you have got spare time on your hands you might want to look at.
      A tutorial on character code issues

      > >>>00001 one
      > >00002 two
      > >00003 three
      > >00004 four
      > >00005 five
      > >00006 six<<
      > >
      > >Is that what you're talking about?
      > Yes that's it. If you select the character and run this clip
      > command on it, it reports it is a decimal character 26.
      > ^!Info ^$ChartoDec(^$GetSelection$)$
      > I did some research and found out this is the same character
      > MS-DOS uses as an end-of-file mark (Ctrl-Z).
      > It doesn't necessarily come back as the last character printed to
      > Notetab, e.g., a reverse sort in Perl will put it at the top. So
      > its a character that really needs to be removed from Perl's
      > standard input buffer. I don't know how to do that.
      > Also Notetab Replace clip commands won't remove it from the
      > output (although the Replace dialog will).
      > The best I've come up with so far is to add this inside to the
      > "while (<>)" loop of each of my Perl scripts that are fed by
      > ^!RunPerl or ^!RunScript:
      > if ($] > 5.006) {
      > $badchar = chr(26);
      > s/($badchar)$//;
      > }
      > But that way it runs on each input unit (e.g., line or paragraph)
      > instead of just the last one (which would be more appropriate).
      > I guess it doesn't matter, but I would like to know how to apply
      > it to the last unit only.
      > Or if there is some better way to approach it that wouldn't
      > require changing each script or clip.
      > Any ideas?
      > Regards,
      > Sheri
      > ntb-scripts-unsubscribe@yahoogroups.com
      > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    • Show all 4 messages in this topic