Menu

ascii symbols

2007-12-19
2012-11-13
  • Nobody/Anonymous

    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

     
    • Nobody/Anonymous

      Perhaps the Simple Script Plug-In can help you.

       
    • Nobody/Anonymous

      Thank you.

      Where can I download this Plug-in?

       
    • Nobody/Anonymous

      Oeps. found it (not on the notepad++ site but in sourceforge)
      thank you

       
    • fidvo

      fidvo - 2007-12-20

      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.

       
    • Nobody/Anonymous

      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"

       
    • Nobody/Anonymous

      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.

       
    • Nobody/Anonymous

      --> 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.

       
    • fidvo

      fidvo - 2007-12-20

      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.

       
    • fidvo

      fidvo - 2007-12-20

      Here's a more comprehensive script.  I think I'll include this with the samples in the next version of Simple Script.

      replacecase("À","&Agrave;")
      replacecase("Á","&Aacute;")
      replacecase("Â","&Acirc;")
      replacecase("Ã","&Atilde;")
      replacecase("Ä","&Auml;")
      replacecase("Å","&Aring;")
      replacecase("Æ","&AElig;")
      replacecase("Ç","&Ccedil;")
      replacecase("È","&Egrave;")
      replacecase("É","&Eacute;")
      replacecase("Ê","&Ecirc;")
      replacecase("Ë","&Euml;")
      replacecase("Ð","&ETH;")
      replacecase("Ì","&Igrave;")
      replacecase("Í","&Iacute;")
      replacecase("Î","&Icirc;")
      replacecase("Ï","&Iuml;")
      replacecase("Ñ","&Ntilde;")
      replacecase("Ò","&Ograve;")
      replacecase("Ó","&Oacute;")
      replacecase("Ô","&Ocirc;")
      replacecase("Õ","&Otilde;")
      replacecase("Ö","&Ouml;")
      replacecase("Ø","&Oslash;")
      replacecase("Œ","&OElig;")
      replacecase("Þ","&THORN;")
      replacecase("Ù","&Ugrave;")
      replacecase("Ú","&Uacute;")
      replacecase("Û","&Ucirc;")
      replacecase("Ü","&Uuml;")
      replacecase("Ý","&Yacute;")
      replacecase("Ÿ","&Yuml;")
      replacecase("à","&agrave;")
      replacecase("á","&aacute;")
      replacecase("â","&acirc;")
      replacecase("ã","&atilde;")
      replacecase("ä","&auml;")
      replacecase("å","&aring;")
      replacecase("æ","&aelig;")
      replacecase("ç","&ccedil;")
      replacecase("è","&egrave;")
      replacecase("é","&eacute;")
      replacecase("ê","&ecirc;")
      replacecase("ë","&euml;")
      replacecase("ð","&eth;")
      replacecase("ì","&igrave;")
      replacecase("í","&iacute;")
      replacecase("î","&icirc;")
      replacecase("ï","&iuml;")
      replacecase("ñ","&ntilde;")
      replacecase("ò","&ograve;")
      replacecase("ó","&oacute;")
      replacecase("ô","&ocirc;")
      replacecase("õ","&otilde;")
      replacecase("ö","&ouml;")
      replacecase("ø","&oslash;")
      replacecase("œ","&oelig;")
      replacecase("ß","&szlig;")
      replacecase("þ","&thorn;")
      replacecase("ù","&ugrave;")
      replacecase("ú","&uacute;")
      replacecase("û","&ucirc;")
      replacecase("ü","&uuml;")
      replacecase("ý","&yacute;")
      replacecase("ÿ","&yuml;")

       
    • Nobody/Anonymous

      great! thank you very much for your explications!!
      Thank you for the long list with ascii codes. :):)