I assume you're talking about something like converting "á" to "á" right?
The above example could be done in Simple Script as either of the following:
replacecase("á","á")
or
replacecase("\#225 ","á")
You just need to string together a bunch of replacecase functions similar to the above. All you have to decide is which characters get converted. In fact, once you determine that, you could even use the merge function in Simple Script to generate the script itself.
Just to warn you, it might be slow on a large file with a lot of replacecase functions.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This is how I did it yesterday:
replace("é","è")
replace("à","à")
replace("è","è")
replace("ò","ò")
replace("ù","ù")
replace("ç","ç")
replace("ì","ì")
Why replacecase?
BTW thank you for your message :)
ps: great plugin this "simple script plugin"
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Because replace isn't case-sensitive. You would probably want to replace the capital and lowercase versions separately.
2) The only (little) problem is that I have to do this for every file (I have more then 30 files)
Someone already requested that I add a "Run Script on All Open Files" menu option, so that will probably be in a future version.
3) Merge function
The Readme_SimpleScript.txt file has some examples of using the merge function. The delimiter is the separator in the list. For example, with a comma-delimited list, the delimiter would be a comma.
I was thinking you wanted to replace certain characters with their ASCII numbers rather than their HTML codes. So you could build the merge list like this:
233
224
233
242
250
231
236
The above numbers correspond to the ASCII values of the letters you want to replace. You would copy the above list to the clipboard.
Then you would put the following merge template somewhere, probably in a new document:
replacecase("\#<%1> ","&#<%1>;")
Highlight the above line, then run the following script on it:
merge(",")
The delimiter in this case doesn't matter because there's only one element in each row of the list. As long as you choose a delimiter that isn't used somewhere in the list, you're fine.
Of course, the above example is not what you want, but you can at least use it as an example to see how to use the merge function.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Does anyone know how to:
1) put html codes for ascii characters in a html file
2) convert automatically all ascii characters in html code
Tnx
Perhaps the Simple Script Plug-In can help you.
Thank you.
Where can I download this Plug-in?
Oeps. found it (not on the notepad++ site but in sourceforge)
thank you
I assume you're talking about something like converting "á" to "á" right?
The above example could be done in Simple Script as either of the following:
replacecase("á","á")
or
replacecase("\#225 ","á")
You just need to string together a bunch of replacecase functions similar to the above. All you have to decide is which characters get converted. In fact, once you determine that, you could even use the merge function in Simple Script to generate the script itself.
Just to warn you, it might be slow on a large file with a lot of replacecase functions.
Yes,
This is how I did it yesterday:
replace("é","è")
replace("à","à")
replace("è","è")
replace("ò","ò")
replace("ù","ù")
replace("ç","ç")
replace("ì","ì")
Why replacecase?
BTW thank you for your message :)
ps: great plugin this "simple script plugin"
The only (little) problem is that I have to do this for every file (I have more then 30 files)
But I suppose there is no solution to resolve this.
--> you could even use the merge function in Simple Script to generate the script itself
I've found the merge function but I do not understand it.
What means the delimiter?
---------------------------------------------------
merge(delimiter): Merges a set of data on the clipboard into the current document.
1) Why replacecase?
Because replace isn't case-sensitive. You would probably want to replace the capital and lowercase versions separately.
2) The only (little) problem is that I have to do this for every file (I have more then 30 files)
Someone already requested that I add a "Run Script on All Open Files" menu option, so that will probably be in a future version.
3) Merge function
The Readme_SimpleScript.txt file has some examples of using the merge function. The delimiter is the separator in the list. For example, with a comma-delimited list, the delimiter would be a comma.
I was thinking you wanted to replace certain characters with their ASCII numbers rather than their HTML codes. So you could build the merge list like this:
233
224
233
242
250
231
236
The above numbers correspond to the ASCII values of the letters you want to replace. You would copy the above list to the clipboard.
Then you would put the following merge template somewhere, probably in a new document:
replacecase("\#<%1> ","&#<%1>;")
Highlight the above line, then run the following script on it:
merge(",")
The delimiter in this case doesn't matter because there's only one element in each row of the list. As long as you choose a delimiter that isn't used somewhere in the list, you're fine.
Of course, the above example is not what you want, but you can at least use it as an example to see how to use the merge function.
Here's a more comprehensive script. I think I'll include this with the samples in the next version of Simple Script.
replacecase("À","À")
replacecase("Á","Á")
replacecase("Â","Â")
replacecase("Ã","Ã")
replacecase("Ä","Ä")
replacecase("Å","Å")
replacecase("Æ","Æ")
replacecase("Ç","Ç")
replacecase("È","È")
replacecase("É","É")
replacecase("Ê","Ê")
replacecase("Ë","Ë")
replacecase("Ð","Ð")
replacecase("Ì","Ì")
replacecase("Í","Í")
replacecase("Î","Î")
replacecase("Ï","Ï")
replacecase("Ñ","Ñ")
replacecase("Ò","Ò")
replacecase("Ó","Ó")
replacecase("Ô","Ô")
replacecase("Õ","Õ")
replacecase("Ö","Ö")
replacecase("Ø","Ø")
replacecase("Œ","Œ")
replacecase("Þ","Þ")
replacecase("Ù","Ù")
replacecase("Ú","Ú")
replacecase("Û","Û")
replacecase("Ü","Ü")
replacecase("Ý","Ý")
replacecase("Ÿ","Ÿ")
replacecase("à","à")
replacecase("á","á")
replacecase("â","â")
replacecase("ã","ã")
replacecase("ä","ä")
replacecase("å","å")
replacecase("æ","æ")
replacecase("ç","ç")
replacecase("è","è")
replacecase("é","é")
replacecase("ê","ê")
replacecase("ë","ë")
replacecase("ð","ð")
replacecase("ì","ì")
replacecase("í","í")
replacecase("î","î")
replacecase("ï","ï")
replacecase("ñ","ñ")
replacecase("ò","ò")
replacecase("ó","ó")
replacecase("ô","ô")
replacecase("õ","õ")
replacecase("ö","ö")
replacecase("ø","ø")
replacecase("œ","œ")
replacecase("ß","ß")
replacecase("þ","þ")
replacecase("ù","ù")
replacecase("ú","ú")
replacecase("û","û")
replacecase("ü","ü")
replacecase("ý","ý")
replacecase("ÿ","ÿ")
great! thank you very much for your explications!!
Thank you for the long list with ascii codes. :):)