Quickly convert a lot of files to another encoding?
-
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]
-
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 foriconv)…EDIT: this site shows a list of iconv encoding names, with
UCS-2LElisted among the assets. -
… 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 otherout-fileencodings and documentation. -
Problem solved. Thanks for the answer!
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