Community
    • Login

    View>Show All Characters not showing all

    Scheduled Pinned Locked Moved General Discussion
    3 Posts 2 Posters 631 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ConexorC
      Conexor
      last edited by

      I am editing a php script so language is set to php and encoding is set to ANSI and I have
      view>show symbol>Show All Characters

      I copied and pasted some code from php.net and I was trying to run the code, I would get an error
      Parse error: syntax error, unexpected identifier “�”, expecting “)” in C:\xampp\htdocs\Test.php on line 26

      Now line 26 is
          throw new RuntimeException('mysqli error: ’ . mysqli_error($mysqli));

      It looks fine doesn’t it :)
      BUT
      if you look between the word error and mysqli you will see a single quote and then a space, then a dot and then a space and then the word mysqli.

      The hex codes of the space dot space are
      A0 2E A0
      Now A0 is not a space.
      If I change to spaces
      20 2E 20 it all works.

      So we have a symbol but it is displayed as a space.

      Any suggestions on how I can highlight all non ascii characters. So presumably all characters above 7E (ie with bit 7 high) would be highlighted. I would have thought that
      view>show symbol>Show All Characters
      should actually show all strange characters.

      Even better, is there a way to paste copied code such that stuff that looks like a space is actually pasted as a space.

      Thanks in advance,
      Frank

      Alan KilbornA 1 Reply Last reply Reply Quote 1
      • Alan KilbornA
        Alan Kilborn @Conexor
        last edited by Alan Kilborn

        @Conexor


        I copied and pasted some code from php.net

        Copying data from websites and pasting into a text file is a good way to encounter the problem that you did. Although… web sites that specialize in code listings typically have easy methods for copying the code without encountering that same problem.


        I would have thought that
        view>show symbol>Show All Characters
        should actually show all strange characters.

        I think the current status of something like this native to Notepad++ is HERE. Also, HERE.
        In short, nothing is implemented natively yet.
        Feel free to add your own thoughts to the above issues – sometimes change only comes from different people repeatedly requesting the same thing.

        As far as add-on functionality goes, there are some solutions presented HERE.


        A0 is not a space.

        Not exactly true…A0 is a special kind of space, in Unicode. The tone of parts of your posting make me think that you have not fully embraced the Unicode concept – you probably should.


        how I can highlight all non ascii characters

        • Invoke the Mark dialog with Ctrl+m, then:
        • Set Find what to [^\r\n\t\x20-\x7E]+
        • Set Search mode to Regular expression
        • Check the Wraparound box
        • Press the Mark All button

        Is there a way to paste copied code such that stuff that looks like a space is actually pasted as a space.

        Not really; you (or someone) could write a script, such that at paste time, what is about to be pasted in could be examined, and then changed before pasting if found to contain “undesirable” – the script writer gets to define what that means – things.

        ConexorC 1 Reply Last reply Reply Quote 1
        • ConexorC
          Conexor @Alan Kilborn
          last edited by

          @Alan-Kilborn said in View>Show All Characters not showing all:

          you have not fully embraced the Unicode concept – you probably should.

          Feels like PHP hasn’t embraced Unicode.

          I’ll read the other references in regards to options and ways to guard against this issue. Thank you.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors