When Notepad++ language is set to something other than English: notepad.runMenuCommand("Encoding", "Convert to UTF-8")
Will not be found, well that's to be expected but it seems the enum: notepad.menuCommand(MENUCOMMAND.FORMAT_CONV2_UTF_8)
Converts to UTF8 with BOM and I can't find a version without BOM.
It be nice to have both enums to convert to UTF8 with and without BOM.
I recently discovered this little plugin and I'm very excited to all the things I'm going to be able to automate from now on ^^ Thank you so much.
Last edit: Christian M 2021-02-27
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
MENUCOMMAND.FORMAT_AS_UTF_8 -> to UTF8 without BOM
MENUCOMMAND.FORMAT_CONV2_AS_UTF_8 -> to UTF8 without BOM
MENUCOMMAND.FORMAT_CONV2_UTF_8 -> to UTF8 with BOM
Thanks!
Side note: notepad.runMenuCommand("Encoding", "Convert to UTF-8")
will convert to UTF8 without BOM notepad.runMenuCommand("Encoding", "Convert to UTF-8-BOM")
will convert with BOM
But it only works when Notepad++ language is set to English
Last edit: Christian M 2021-02-27
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Regarding "English"...for whatever localization you're using, can't you just replace the strings with whatever are appropriate for the language, and have it work?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Well for certain languages it's really hard to guess what character coding where used to represent the string in the menu. But just for giggles I challenged myself and tried, after failing a few times to infer from the menu what it was, and when I was about to give up, I had the idea to look up the raw translation in xml: https://github.com/notepad-plus-plus/notepad-plus-plus/tree/master/PowerEditor/installer/nativeLang
My language is Japanese so the corresponding entries in the xml are:
When Notepad++ language is set to something other than English:
notepad.runMenuCommand("Encoding", "Convert to UTF-8")
Will not be found, well that's to be expected but it seems the enum:
notepad.menuCommand(MENUCOMMAND.FORMAT_CONV2_UTF_8)
Converts to UTF8 with BOM and I can't find a version without BOM.
It be nice to have both enums to convert to UTF8 with and without BOM.
I recently discovered this little plugin and I'm very excited to all the things I'm going to be able to automate from now on ^^ Thank you so much.
Last edit: Christian M 2021-02-27
Not 100% certain, but perhaps MENUCOMMAND.FORMAT_CONV2_AS_UTF_8
That was it, to summarize:
Thanks!
Side note:
notepad.runMenuCommand("Encoding", "Convert to UTF-8")
will convert to UTF8 without BOM
notepad.runMenuCommand("Encoding", "Convert to UTF-8-BOM")
will convert with BOM
But it only works when Notepad++ language is set to English
Last edit: Christian M 2021-02-27
Regarding "English"...for whatever localization you're using, can't you just replace the strings with whatever are appropriate for the language, and have it work?
Well for certain languages it's really hard to guess what character coding where used to represent the string in the menu. But just for giggles I challenged myself and tried, after failing a few times to infer from the menu what it was, and when I was about to give up, I had the idea to look up the raw translation in xml:
https://github.com/notepad-plus-plus/notepad-plus-plus/tree/master/PowerEditor/installer/nativeLang
My language is Japanese so the corresponding entries in the xml are:
Which actually translates to:
notepad.runMenuCommand("エンコード(N)", "UTF-8 に変換")
What a journey XD