Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Help with making a simple plugin

    Plugin Development
    2
    4
    2686
    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.
    • 0Megaman54
      0Megaman54 last edited by

      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.

      Claudia Frank 1 Reply Last reply Reply Quote 0
      • Claudia Frank
        Claudia Frank @0Megaman54 last edited by

        @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

        0Megaman54 1 Reply Last reply Reply Quote 0
        • 0Megaman54
          0Megaman54 @Claudia Frank last edited by

          @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
          • 0Megaman54
            0Megaman54 last edited by 0Megaman54

            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
            • First post
              Last post
            Copyright © 2014 NodeBB Forums | Contributors