• Login
Community
  • Login

Open Notepad++ via command line with a certain character set

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
14 Posts 4 Posters 2.2k 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.
  • W
    whitecat @datatraveller1
    last edited by Nov 4, 2022, 8:20 AM

    @datatraveller1,

    indeed, this solves my specific problem. Thank you for this hint. I had to modify my script though, now the logfile gets written into a file with a special extension (.log850) which I configured in the plugin.

    But the general problem remains - what to do with files from applications with given extensions? I would consider such a command line option as very useful.

    A 1 Reply Last reply Nov 4, 2022, 1:10 PM Reply Quote 0
    • A
      Alan Kilborn @whitecat
      last edited by Nov 4, 2022, 1:10 PM

      @whitecat said in Open Notepad++ via command line with a certain character set:

      But the general problem remains … I would consider such a command line option as very useful.

      How would you envision such a command line syntax?

      notepad++ yourfile.ext -charset="OEM 850"

      D 1 Reply Last reply Nov 5, 2022, 12:41 PM Reply Quote 1
      • D
        datatraveller1 @Alan Kilborn
        last edited by datatraveller1 Nov 5, 2022, 12:41 PM Nov 5, 2022, 12:41 PM

        I would find this option which could be named
        -charset or maybe more “mordern” -encoding
        also very useful, so I upvoted your Github issue #8082

        W 1 Reply Last reply Nov 5, 2022, 5:00 PM Reply Quote 3
        • W
          whitecat @datatraveller1
          last edited by Nov 5, 2022, 5:00 PM

          @datatraveller1
          @Alan-Kilborn

          Notepad++ is capable of opening several files at once via command line, so the syntax could be enhanced in order to support opening different files with different charsets:

          notepad++ yourfile1.ext -charset="OEM 850" yourfile2.ext -charset="UTF-8 BOM"

          (or similar).

          A 1 Reply Last reply Nov 6, 2022, 12:30 PM Reply Quote 1
          • A
            Alan Kilborn @whitecat
            last edited by PeterJones Nov 9, 2022, 7:18 PM Nov 6, 2022, 12:30 PM

            @whitecat said in Open Notepad++ via command line with a certain character set:

            notepad++ yourfile1.ext -charset=“OEM 850” yourfile2.ext -charset=“UTF-8 BOM”

            That syntax feels “not quite right”.

            Given the current possible command line is defined like this:

            notepad++ [–help] [-multiInst] [-noPlugin] [-lLanguage] [-udl=“My UDL Name”] [-LlangCode] [-nLineNumber] [-cColumnNumber] [-pPosition] [-xLeftPos] [-yTopPos] [-monitor] [-nosession] [-notabbar] [-ro] [-systemtray] [-loadingTime] [-alwaysOnTop] [-openSession] [-r] [-qn=“Easter egg name” | -qt=“a text to display.” | -qf=“D:\my quote.txt”] [-qSpeed1|2|3] [-quickPrint] [-settingsDir=“d:\your settings dir”] [-openFoldersAsWorkspace] [-titleAdd=“additional title bar text”][filePath]

            See how filePath is the last thing, and things BEFORE it affect it, e.g. -nLineNumber?

            IMO, it makes more sense to have your proposed command line work as follows:

            notepad++ yourfile1.ext -charset="OEM 850" yourfile2.ext -charset="UTF-8 BOM" yourfile3.ext yourfile4.ext

            • yourfile1.ext would not be affected by any -charset influence
            • yourfile2.ext would be opened and its encoding set to OEM 850
            • yourfile3.ext would be opened and its encoding set to UTF-8 BOM
            • yourfile4.ext would be opened and its encoding set to UTF-8 BOM
            W 1 Reply Last reply Nov 6, 2022, 12:47 PM Reply Quote 1
            • W
              whitecat @Alan Kilborn
              last edited by Nov 6, 2022, 12:47 PM

              @Alan-Kilborn

              Yepp - you’re right, this would be more consistent.

              D 1 Reply Last reply Nov 6, 2022, 3:44 PM Reply Quote 1
              • D
                datatraveller1 @whitecat
                last edited by datatraveller1 Nov 6, 2022, 3:47 PM Nov 6, 2022, 3:44 PM

                I’m wondering who decides if this feature request is implemented? Is there a particular procedure for a feature request?

                A 1 Reply Last reply Nov 6, 2022, 3:49 PM Reply Quote 0
                • A
                  Alan Kilborn @datatraveller1
                  last edited by Alan Kilborn Nov 6, 2022, 3:50 PM Nov 6, 2022, 3:49 PM

                  @datatraveller1 said in Open Notepad++ via command line with a certain character set:

                  I’m wondering who decides if this feature request is implemented? Is there a particular procedure for a feature request?

                  So the feature request is now an “issue”, which means it can get developer attention. The main author of Notepad++ can work on it, which gives it about a 100% to be accepted into the codebase, when complete. Or, someone else can work on it, and even if they finish a nice implementation on it, there is no guarantee that the author will accept it into the codebase. Or…nothing will ever happen on it (there are a lot of open bug issues, and a lot of other feature request issues).

                  D 1 Reply Last reply Nov 6, 2022, 3:53 PM Reply Quote 2
                  • D
                    datatraveller1 @Alan Kilborn
                    last edited by Nov 6, 2022, 3:53 PM

                    @Alan-Kilborn ok, I understand. Thank you!

                    1 Reply Last reply Reply Quote 0
                    • A
                      Alan Kilborn
                      last edited by Alan Kilborn Nov 9, 2022, 7:06 PM Nov 9, 2022, 6:54 PM

                      Earlier I had said:

                      IMO, it makes more sense to have your proposed command line work as follows:

                      notepad++ yourfile1.ext -charset=“OEM 850” yourfile2.ext -charset=“UTF-8 BOM” yourfile3.ext yourfile4.txt

                      While that’s an idyllic command line, logically, it doesn’t really suit how Notepad++ currently works; example:

                      notepad++ -multiInst -n15 yourfile1.txt -n10 yourfile2.txt

                      While this will open “yourfile1.txt” at line 15, it will NOT open “yourfile2.txt” at line 10.

                      But this:

                      notepad++ -multiInst -n15 yourfile1.txt yourfile2.txt

                      will open both files at line 15.

                      So I think it is reasonable to allow only one -charset=... on a command line, that affects all following files; example:

                      notepad++ yourfile1.ext -charset="UTF-8 BOM" yourfile3.ext yourfile4.txt <-- contains only ONE charset directive.

                      If a second -charset is encountered on the command-line, it would be ignored.

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