Community
    • Login

    Quickly convert a lot of files to another encoding?

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    4 Posts 2 Posters 4.7k Views 2 Watching
    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.
    • GaroKG Offline
      GaroK
      last edited by

      Hello.
      So I’ve been translating a certain mod for a game, from Russian to Polish.
      Even though saving in ANSI should save both polish and russian characters, it did not for some reason. The only way I managed to get the notepad to save both character types was saving in UCS-2 LE BOM.
      Once all the work was done, I found out the files have to be in ANSI in order for them to compile correctly. And I don’t feel like exploring every folder, and check every file, then manually changing the encoding to ANSI.

      So here’s the question: Is there a program that can allow me to do it faster?

      [BTW: Now that I reinstalled N++, it saves in ANSI correctly, shame that it’s too late]

      1 Reply Last reply Reply Quote 0
      • PeterJonesP Online
        PeterJones
        last edited by PeterJones

        Someone could write a script to do it, like using Notepad++'s PythonScript plugin. But batch-encoding conversion isn’t really Notepad++'s niche.

        However, since you weren’t able to convince Notepad++ to do encodings properly to begin with, I did some googling for you. This superuser reply seems to do what you want… except you’d want iconv -f UCS-2LE -t windows-1252 (or whatever the proper names for UCS-2-LE and “ANSI” are for iconv)…

        EDIT: this site shows a list of iconv encoding names, with UCS-2LE listed among the assets.

        1 Reply Last reply Reply Quote 2
        • PeterJonesP Online
          PeterJones
          last edited by PeterJones

          … or the answer right below that, showing a power-shell way; you could just use the encoding of Unicode, which is MS misnomer for UCS-2LE. See https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/out-file?view=powershell-6 for the other out-file encodings and documentation.

          1 Reply Last reply Reply Quote 2
          • GaroKG Offline
            GaroK
            last edited by

            Problem solved. Thanks for the answer!

            1 Reply Last reply Reply Quote 1

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            • First post
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors