• Login
Community
  • Login

Help with making a simple plugin

Scheduled Pinned Locked Moved Notepad++ & Plugin Development
4 Posts 2 Posters 2.9k 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.
  • 0
    0Megaman54
    last edited by Jul 7, 2016, 4:58 PM

    I want to make a plugin that converts all opened files to UTF-8 or other if the opened file is in ANSI format.
    I downloaded the example plugin and took a brief look at the code but did not really understand the structure of it and couldn’t really find anything useful on the wiki. If someone could point me in the right direction, i would greatly appreciate that.

    C 1 Reply Last reply Jul 7, 2016, 10:42 PM Reply Quote 0
    • C
      Claudia Frank @0Megaman54
      last edited by Jul 7, 2016, 10:42 PM

      @0Megaman54

      I assume you need to use these two messages

      NPPM_GETNBOPENFILES
      NPPM_SETBUFFERENCODING

      to get the work done. But did you try to record a macro doing this conversion?
      Or using python script or lua script plugin?

      Cheers
      Claudia

      0 1 Reply Last reply Jul 7, 2016, 10:53 PM Reply Quote 0
      • 0
        0Megaman54 @Claudia Frank
        last edited by Jul 7, 2016, 10:53 PM

        @Claudia-Frank

        Thanks, I will look into those messages soon.
        The reason I would like to make a plugin instead of a macro or script is that I want the conversion to be done automatically when I open any ANSI encoded file. I wouldn’t need this if Windows created UTF-8 encoded files but as it creates ANSI files instead, I need this plugin and fortunately it seems simple enough to make.

        1 Reply Last reply Reply Quote 0
        • 0
          0Megaman54
          last edited by 0Megaman54 Jul 8, 2016, 9:44 AM Jul 8, 2016, 9:41 AM

          NPPM_SETBUFFERENCODING works only for new and unedited files and i need to also modify opened files that have text in them.
          Is there a message to convert the file to UTF-8?

          EDIT: I found it in the header files, IDM_FORMAT_CONV2_AS_UTF_8 and IDM_FORMAT_CONV2_UTF_8.

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