Plugin 'AutoCodepage v1.2.7' for 'notepad++ v8.7.4' not working?
Hello, in a batch file I redirect the directory contents to a file using dir > File.oem850.
In AutoCodepage, I configured the settings as shown in the online examples. When I load the created file, .oem850, into Notepad++, the OEM 850 encoding isn't enabled. The status bar still shows UTF-8. I can enable OEM 850 manually, but then I don't need AutoCodepage anymore. Do you have any idea where the problem lies? Regards, Hein
I don’t know what you want to use a completely outdated plugin for.
The problem is not NP++ or any plugin, but your understanding of character encoding…
Under up to and including Windows 7, there are various disagreements regarding the coding of Batch. (many were founded in bad “yet obsolete” instructions.) …and to this day I read instructions from people who have no idea which use any 12xx magic to display characters readable. You only have to work with UTF8.
Generally, the output of the Windowsconsole (cmd.exe) “yet” works with the Codepage 850. (to be compatible with old garbage)
I tried to track your scenario, the status line indicates ANSI by default (as expected). The code page is completely sausage for the first time. ANSI merely states : 8 bits per character. Since there is no explicit labelling in BOM-less files with regard to coding can only be guessed by an editor/application on the basis of the content which coding is present. Some strings make more sense among the different encodings than others. Generally, there are no recognizable difference between ANSI and UTF-8 for files that contain only characters with an ASCII code <127!
If you use the “dir command”, there are already significant differences between screen output and file redirection.
The Windows file system generally no longer works with local 12xx codepages, but with UTF-8 names! Thus, all file names of “dir” UTF-8 are also supplied coded to Console (cmd).
What makes the console depends on the preset coding and the output “medium”.
If you want to explicitly specify which encoding should be done, use the chcp command
as I said, this does not change the interpretation of any UTF characters read in.
I can only recommend working with UTF-8 on modern systems.
Batch (.cmd) files basically save as UTF-8 file without BOM and set the appropriate codepage 65001 on the start of the batch.
..that makes the least trouble on modern systems.
If you want to work quite modern, forget Batch and use Powershell and explicitly give the desired file operations Encoding on.
Your examples do not succeed. Why outdated plugin? It’s from 2024.
I don’t think you read the question correctly… It was never meant to get explained how character coding works. So much written and yet nothing said
Do you open the file directly with NP++?
If so, it may be the fault here.
I don’t know if the case of opening a new file, possibly zsm with opening Np++, triggers the first event, but the other events don’t happen
So try to open multiple files and see what happens when you jump back and forth between the tabs
Hello. It doesn’t matter if I click on the created file in np++ via “Open…” lade or in the Explorer twice and so load the file in np++. In both cases, OEM 850 is not activated. Even if I load several files with the .oem850 extension, it is also not switched to OEM 850.
Found the problem. You proceed as follows:
With this you have added one of many possible extensions to your group. On the left hand side the groups and on the right side the extensions belonging to the selected group are displayed
Thanks for the hint. My file.oem850 is just a text file.
All right, I’m glad. If you haven’t found out yet, Expected Language allows you to set the programming/ script language of the file in the Notepad menu in addition to the coding method
Thanks for your help and stamina. It worked. I left ‘Expected language’ empty. Now AutoCodepage does exactly what to do.
In the private chat, it is not possible, but you can adjust images to the original question afterwards, but no matter. Code Page to Set must be clicked in your case OEM850. Expected Language is optional why I’m released. It is important, as said, that at the end before you close the window, at least one entry is in the two white rectangular areas JEWEILS.
Set images is not possible. good question deliberately has no possibility to post images in private chat. I set the settings as you described. What values have you entered in ‘Code page to set’ and ‘Expected language’?
You ask me what😅 Never made a contribution here… You can add pictures and text to your original question, but I’m overwhelmed
How do I picture here?
Please check the settings again, or set an image here. I installed the v1.2.7 plug-in with me in NP++, set the settings as described by me and created a test file test.OEM850. The system automatically changes the coding when the file is opened. Either the plug-in is erroneously installed with you or you have an error in the settings…
I defined the settings in AutoCodepage immediately after installation. That was what I wrote. That’s not the problem.