How to force page code OEM-863 initialized permanently as default ?
-
Hi all,
I’m french and i would like to have the page code OEM-863 selected permanently.
- How to configure Notepad++ for having the page code OEM-863 initialize as default in file and in visualisation.
- an other way ? what is the name of the macro which is automaticaly executed before starting edition ?
Actually, obliged to initialize that manualy !..
Thanks for your aid
Lou Papet -
I wanted to say “help” in place of “aid” which is a french troncated word !..
excuse me.
Lou Papet -
You can specify it for new documents under settings->preferences-new document
For existing documents this might not work if, for example, you have activated
autodetect character encodingCheers
Claudia -
Good evening Claudia,
Thank you very much for your answer.
I have already initialized all the parameters you propose to me but I still have to manually switch to
Encoding => Character Set => Western european => OEM 863: French
to display my files with accented characters.
If I forget to do it, my file is always initialized with the ANSI page code.
I don’t understand why it is not permanent !..I wish that the software does it automatically as soon as it is configured before editing.
Is it possible ?
Cordially
Jean-Pierre -
do you mean this happens even for new (empty) documents? This shouldn’t be.
Concerning ANSI - this is neither an encoding nor a codepage this is Microsofts
contribution to confuse the users when it comes to understand file/data encoding.Is it actually a problem for you? I mean, are the accented characters shown incorrectly?
If not, then it doesn’t matter because using the codepage 863
does not make any difference when it comes to storing the data if the encoding is
set to ANSI.Do you, by any chance use the python script module?
If so, could you open the console and execute the following code in the run area?import ctypes; ctypes.windll.kernel32.GetACP()
Cheers
Claudia -
Hello Claudia,
With the settings that I had put and you confirmed to me the code “OEM-863” in " new document “”, the opened file well contains the accented letters but when I open the file, I have to start
“Encoding => Character Set => Western european => OEM 863: French”
to see the accented letters displayed.
It is this last operation that I would like to see automatic.Is the setting “OEA-863” correct ? not “EOM 863” or “OEM_863” ???
By the other way, when I click on the shortcut “Notepad ++” in my desktop to launch the program, I have put as command
“notepad ++. exe -LOEM-863”.
Is it well coded ?Cordially
Jean-Pierre -
Salut Jean-Pierre
It is this last operation that I would like to see automatic.
Understood - it can be done but not with native npp settings/functions.
For example by using python script plugin.
But the point which is unclear for me at the moment is whether it is really needed.So, just to be 100% sure.
If you open an existing file the statusbar shows that it is ANSI encoded and
you do either not see your accented letters displayed or those letters aren’t
correctly display, correct?This is really a needed info because codepage OEM 863 has no impact when saving data and I assume you want to save your data in the correct format as well.
The -L switch changes the UI language and needs to be in form of fr in your case.
So -Lfr or -Lfr-be (but not sure if the latter is actually supported by npp)Cheers
Claudia -
671/5000
Good evening Claudia,Despite the set parameters, when I open a file, it is always marked ANSI in the status bar and I have to manually select “OEM-863: French” otherwise the ANSI characters are saved in the file. After, I have to correct them one by one with the Find / Replace tool
Is it not possible that the software automatically launches before any edition simply a macro with a particular name like “Profile” for example.
Since I am talking about macro, how is it possible to access the source code in order to modify it? With macro recording, there are even a few restrictions.
It’s a bit of a shame because the software is excellent.
I forgot: I tried -Lfr and it’s the same
Best regards
Jean PierrePost scriptum : How do you insert an image into the message as you do it yourself?
-
Hello Jean Pierre,
the -L switch just changes the UI language not the encoding of files.
If, for example you start npp with -Lde you would see the menu, settings etc…
in German. -Lfr shows everything in French.The source code is available on github.
To include an image you need to upload the image to a hoster like imgur.com and use the following syntax
![](URL_OF_THE_UPLOADED_IMAGE)
.Now, ANSI and OEM-863: French - no, npp has no builtin way to do such thing.
A possible workaround could be made using python script plugin but I’m
still confused about your saying that you need to find/replace characters.If you want to go the python script way - install the plugin via plugin manager
and let me know.Cheers
Claudia -
hello Claudia,
Thank you again for all your informations.
- I understood the meaning of the -L parameter,
- “« The source code is available on github »”: I’m not interested by the source code of Notepad++… only by the source code of the macro created with the option
“Macro => Start recording … Stop recording => Save recorded macro”.
I guess it’s coded in Python. - « Now, ANSI and OEM-863: French - no, npp has no builtin way to do such thing » : I did not really understand what you mean !. But, I try to show you in image what I do manually and that I would like automatic :
First, the "OEM 863 : French is well initialized in Prefrences.
- 1 - I run notepad++,
- 2 - I open a new document, enter accented characters, save as “toto.txt” :
You can see le “OEM-863 : French” is well specified in the status bar, and the accented characters correctly displayed, - 3 - I quit notepad++
- 4 - I run again notepad++,
- 5 - I open “toto.txt”,
You can see ANSI is selected, specified in the status bar and the accented characters are not correctly displayed, - 6 - I do
"Encoding => Character sets => Western European => EOM 863 French
You can see OEM 863 : French is set and the accented characters are good displayed.
Best regards,
Jean-Pierre -
Hello Jean-Pierre
yes, now I understand - a picture say’s more then 1000 words.
Macros are save in shortcuts.xml file, file with some cryptic action messages - no python.
Not sue if this can be done with a macro as setting the code page isn’t exposed with a message
that could be used.Let me think about it.
Cheers
Claudia -
Good evening Claudia,
Following your message, I went right away to see the file “Shorcuts.xml” containing the macros with the “action messages” that you quoted me and also the “Daring Fireball MarkDown documentation” under my eyes.
I am quite surprised by the technical choices. To maintain, it must be amazing! … no?
In these circumstances, I do not think I have an answer to my question. I was just asking for feasibility … so I stay in that way. Too bad for the automaticity of the configuration ! …
I did not find, in my installation notepad ++, the configuration of the plugins Python. I may not be very smart. Maybe i have perhaps to download something too.Anyway, I’m not a Python user. I made my weapons with FreeCad animations. I prefer to continue programming in basic C which is for me is a superb assembler evolved with which we can do everything. It’s not for nothing if the Unix system is written in C except for a few really essential kernel modules written in assembler.
Thanks for your help. Are you developper under notepad++ ?
Best regards
Jean PierreP.S. a little symbol from french home : a little cicada that sings the sun of Provence.
-
Bonjour, Jean-Pierre,
I’m going to speak, a bit, in French but, in the second part, I’ll give some clues to @claudia-frank !
Tout d’abord, note bien que l’option Paramètres > Sauvegarde > Mémoriser la session actuelle est cochée dans ma configuration et que de nombreux fichiers sont, en général, simultanément ouverts dans ma session courant N++ v7.5.6.
-
Donc, Jean-Pierre, j’ai changé le paramètre, concenant les nouveaux documents, de
UTF-8
àOEM 863
. -
J’ai créé un nouveau ficher (
Ctrl + N
) puis ai saisi rigoureusement le même texte que toi et ai sauvegardé ce fichier avec pour nom toto.txt. -
J’ai alors fermé N++ puis relancé N++. Aucun souci, l’onglet toto.txt était bien présent, avec l’encodage OEM 863 et les caractères accentués corrects !
-
Puis j’ai eu l’idée de fermer uniquement le fichier toto.txt. Dans ce cas, SANS sortir de N++, si tu ré-ouvres le fichier toto.txt, situé dans le menu Fichier => Bingo, cette fois, j’obtiens exactement le même résultat erroné que toi :-((
Mais, si tu choisis, à nouveau l’encodage OEM 863, tout est, à nouveau,correct. Et, tant que l’onglet toto.txt reste ouvert, tu peux fermer et ré-ouvrir Notepad++ sans problème : l’encodage est bien sauvegardé :-))
-
For info, I usually have the option Preferences > Backup > Remember Current seesion for next lauch ticked and numerous files are most of the time, opened in my current N++ v7.5.6 session
-
So, I first changed the parameter for New documents, from
UTF-8
toOEM 863
-
I created a new file, and typed, exactly, the same characters as Jean-Pierre and saved it as toto.txt
-
After closing and restarting N++, the Toto.txt text was still present with encoding
OEM 863
and the correct accentuated characters !
Then I decided to close the Toto.txt tab only, without closing N++. In that case, clicking on this file, present in the file history, it is opened with the ANSI encoding ( Actually the Windows-1252 encoding for French people ! ) and, of course, the characters seems corrupted !
But, if you choose, again, the
OEM-863
encoding, everything goes fine, again. And you can stop and re-start N++, without any problem, as long as the Toto.txt tab is opened when you decide to exit N++:-))Cheers,
guy038
P.S. :
Jean-Pierre, tu pourrais, aussi, utiliser l’encodage
OEM-850
. Jettes un oeil à ces deux liens :https://en.wikipedia.org/wiki/Code_page_863
https://en.wikipedia.org/wiki/Code_page_850
Il me semble, par exemple, que, si tu ouvres une console DOS ( cmd ), l’encodage par défaut, est
OEM 850
, on French configurationsTapes l’ordre
chcp
suivi de Entrée pour vérification etchcp 863
si tu as besoin de cet encodage, sous DOS -
-
Hi Guy,
thank you for your help - I agree with Jean-Pierre and all the others who
want to have a way to “force” an encoding/codepage - would be really helpful sometimes.@Jean-Pierre
I guess I found a way to let a macro do the clickings but still not really fully automated.
Put this into shortcut.xml and restart npp,<Macro name="SetOEM863" Ctrl="no" Alt="no" Shift="no" Key="0"> <Action type="2" message="0" wParam="45056" lParam="0" sParam="" /> </Macro>
then you should have an additional entry in Macro menu called SetOEM863.
Here you can assign a shortcut to that Macro which, maybe makes the life a little bit easier.No, I’m not really a notepad++ developer, did some minor pull request but
I’m still learning c++.Unfortunately since, 7.5 it is normal that you don’t have the plugin manager bundled.
See here on how to get it back.I agree C is nice but I felt in love with python :-)
Nice cicade, somehow it looks like une broche (???) :-D
Cheers
Claudia -
Hello Claudia, Hello Guy038,
Thank you both for trying to help me.
To Guy,
Personally, I unchecked the “memorization of the current session”. I can open several files, but when I go out, I want to be sure that all my files are saved. This seems to me, of course, cleaner and simpler.
I understand very well that, in a session, the setting is preserved.When I open a console, I run an “lp.bat” to be positioned in the correct directory. In this “.bat”, I just coded “chcp 863” so that the accents are displayed when I run a program. Unfortunately, when I debbug, “gdb” does not resituate the accented characters that I have in my program. But that does not matter, it’s in debbug ! …
Your French is impeccable.
To Claudia,
I already have a macro “lp” which switches the edition in OEM-863. I created it with the macro option.
I have another “accents” that converts all the accented characters when I edit an old file. For that one, it was a little more laborious.A very personal note as an aside :
I practiced a lot of languages in my career as a computer system engineer, for the most recent (!!! … C => 1979), PHP that i like well to use, it is very near of the C langage, C++ (Eurocopter), Python (FreeCad) , Java (Android phone), a little Perl a long time ago but, I consider, only from my point of view, that they are ersatz of the old C language who has the lowest expension rate. We are permanently talking about object-oriented programming but we forget that we live in an object-oriented system since the Big Bang, that is to say for 13 milliard years and we never talk about object-oriented execution. This is not a language, only a turn of mind.
I write about this in my site “http://jeanpierre.rousset.free.fr/Informatique/Noyau_Graphique/index.html” to show an interesting recursive way to use the console in applications that can be interactive. But,… written in french !.., sorry !..Best Regards
Jean-Pierre -
Hello, @Jean-Pierre-Rousset,
Tu as dis :
Your French is impeccable.
Tu plaisantes, je suppose ? J’espère bien car je suis un pur Français, vivant à Grenoble, pas très loin de la Provence !!!
You said :
Your French is impeccable.
You’re joking, aren’t you ? Quite pleased to hear this, because French is my mother language and I’m living in Grenoble, not very far from Provence ;-))
Cheers
guy038
-
Bonsoir Guy,
Le plus beau, c’est que je ne plaisantais pas. Je suis profondément désolé. Je n’avais pas regardé votre profil tant je croyais sincèrement que vous étiez anglais ou américain. J’avoue que j’avais tout de même un peu tilté sur le français.
Toutes mes plus plates excuses !.. Pas fâché j’espère ?
Next time I will be careful !..
I’m situated in Vitrolles en Provence.Cordialement.
Jean-Pierre -
@Claudia-Frank said:
<Macro name="SetOEM863" Ctrl="no" Alt="no" Shift="no" Key="0"> <Action type="2" message="0" wParam="45056" lParam="0" sParam="" /> </Macro>
Good evening Claudia,
I wrote: "I already have a macro “lp” which switches the edition in OEM-863. I created it with the macro option. ". This macro works in another context since it contains a backup of the file. Well NPP does not consider switching to OEM863 as a file’s modification. So, it is not good.
So it is rather your proposal that is much better because it only performs the switch to the encoding OEM-863.
Thank you very much so, … adopted! …
Cheers (I did not know this expression in this actual context ! …)
Jean Pierre -
Jean-Pierre
Cheers (I did not know this expression in this actual context ! …)
me too until, I was working with an Irish man as he always shouted CHEERS,
regardless if it was in the morning when he arrived in the bureau or when a went home.
I loved it - especially with the accent he had - I always had to smile. So I adopted it.CHEERS
ClaudiaBtw. if you want to have this more automated we still can go one step further but
this would mean you have to install the python script plugin. -
Good evening Claudia,
@ Claudia-Frank said:
Btw. if you want to have this more This would mean you have to install the python script plugin.
I thank you for your proposal but I think I’ll leave it there without trying to give you extra work.
I read in the documentation, I don’t know nomore where, the Plugins Manager was removed by the developper (or the team to developper) and he was writing one without publicity. I will wait. Your macro is enough for me now.I’m of course a little surprised by the technical choices to manage macros but I see this through my experience as a developer at the Eurocopter helicopters manufacturing in Marignane where I wrote in the 1975s under a SEL 85 computer (System Engeniering Laboratories acquired by Gould) a text editor that reproduced exactly the main features of IBM’s “XEDIT” editor running under VM/CMS to simplify the work of users.
In this editor, I had of course imited the macros written in “REXX” IBM proprietary language. The macro “profile xedit” was automatically executed before any editing to do what I would have liked it to be done with notepad++. Maybe I have my mind a bit distorted by my basic IBM training ! …
Anyway, I thank you very much again for your help. Perhaps for a next time ! …
Cordialy and best regardsJean-Pierre