Converting XML text structure with encoded markup characters

Converting XML text structure with encoded markup characters

13
Basic UserBasic User
13

    Nov 15, 2010#1

    Hello,

    the following xml text structure has encoded markup signs:

    %3C%3Fxml+version%3D%221.0%22+encoding%3D%22UTF-8%22%3F%3E%3C ...

    [How] can this xml text structure be imported or converted in UltraEdit to be displayed as decoded XML text without encoded markups?

    I'm working with version 11.10c+1.

    Thomas Wiedmann

    6,675585
    Grand MasterGrand Master
    6,675585

      Nov 15, 2010#2

      Your version of UE does not support scripts. With a script it would be very easy to search for %[0-9A-F][0-9A-F] and convert the hexadecimal value of the encoded characters to characters.

      So you have to use a macro for that job with the macro property Continue if a Find with Replace not found checked for this macro.

      InsertMode
      ColumnModeOff
      HexOff
      UnixReOff
      Find MatchCase "%22"
      Replace All """
      Find MatchCase "%3C"
      Replace All "<"
      Find MatchCase "%3D"
      Replace All "="
      Find MatchCase "%3E"
      Replace All ">"
      Find MatchCase "%3F"
      Replace All "?"

      Edited on 2010-11-27: More easily is to select the encoded text and use command HTML Decode from the HTML toolbar.
      Best regards from an UC/UE/UES for Windows user from Austria

      13
      Basic UserBasic User
      13

        Nov 16, 2010#3

        Thanks for this hint. Again and again I'm surprised about the features of UltraEdit. I still added some statements.
        So for all, who'll have a similar task sometime, here's my macro script DecodeMarkups:

        InsertMode
        ColumnModeOff
        HexOff
        UnixReOff
        Find "%0A"
        Replace All "^n"
        Find "+"
        Replace All " "
        Find "%21"
        Replace All "!"
        Find "%22"
        Replace All """
        Find "%26"
        Replace All "&"
        Find "%28"
        Replace All "("
        Find "%29"
        Replace All ")"
        Find "%2C"
        Replace All ","
        Find "%2F"
        Replace All "/"
        Find "%3A"
        Replace All ":"
        Find "%3B"
        Replace All ";"
        Find "%3C"
        Replace All "<"
        Find "%3D"
        Replace All "="
        Find "%3E"
        Replace All ">"
        Find "%3F"
        Replace All "?"
        Find "%5B"
        Replace All "["
        Find "%5C"
        Replace All "\"
        Find "%5D"
        Replace All "]"