I regularly develop batch scripts (*.cmd). As you know, these files use old dos oem/ascii charset. This is important when, as a French, I have to use accentuated characters.
When selecting the default "Batch file" editing mode, the charset used is ansi, so accentuated characters are wrong. But if I switch to "NFO" style, the charset used is the good oem/ascii one. But in this case I lose the syntax coloring.
I was wondering how, editing styles, I could combine the advantage of both display modes and get batch syntax coloring with ascii charset.
Thank you for your help, vlaKoff
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I regularly develop batch scripts (*.cmd). As you know, these files use old dos oem/ascii charset. This is important when, as a French, I have to use accentuated characters.
When selecting the default "Batch file" editing mode, the charset used is ansi, so accentuated characters are wrong. But if I switch to "NFO" style, the charset used is the good oem/ascii one. But in this case I lose the syntax coloring.
I was wondering how, editing styles, I could combine the advantage of both display modes and get batch syntax coloring with ascii charset.
Thank you for your help, vlaKoff
I'd try using Terminal, Fixedsys or some similar font for highlighting DEFAULT Batch style element. Or anything with OEM encoding.
CChris
thank you,
Fixedsys doesn't work, but yes Terminal does work.
however this font isn't very scalable, it is far less confortable to use than the default Courrier New... moreover I zoom in/out a lot
since NFO style displays accents ok with Courrier New, it's very likely some trick can be found to use it for batch editing with accents...
see you
Try the following macro, to be inserted in the <Macros> section of shortcuts.xml. Edit preferrably with Notepad, N++ being closed:
<Macro name="OEM_charset" Ctrl="yes" Alt="yes" Shift="no" Key="100">
<Action type="0" message="2066" wParam="32" lParam="255" sParam="" />
</Macro>
Then reopen Notepad++, and fire the macro.
The following macro reverts the change:
<Macro name="ANSI_charset" Ctrl="yes" Alt="yes" Shift="no" Key="101">
<Action type="0" message="2066" wParam="32" lParam="0" sParam="" />
</Macro>
Change key bindings from Shortcut mapper as you see fit.
Not tested, but should work _if your font supports the OEM character set_.
CChris
Apparently, you must fire the macro first, then change font. And change it twice so that the change is being seen.
CChris
Thank you CChris
I confirm the change is not immediate and does need font switching after the macro has been run
However I currently still consider "edit.com" as the simplest way to edit accents in my files... lol
See you