Forum rules
PLEASE don't post images of your entire desktop, attach entire campaign files when only a single file is needed, or generally act in some other anti-social behavior.
So, I'm trying to write a little tool to convert character sheets/monsters from Maptools to a tool I wrote (external) and then import. Basically a character editor for the players they can do offline... however I'm running into an issue trying to figure out something.
I use "encode()" in a maptools macro on a few things that are written to the contents.xml file. The raw text looks like this.
I've tried a few perl modules to "decode" that. XML/HTML::Entities but neither seem to return it to a normal "string" of clean text. Any theories on how I can get around this? I really need this to be something I can do on the export/import side (not inside maptools).
Encode will change non alphanumeric characters in to %[hex value in ascii] except for the space which is a + symbol and the semi-colon is %26semi%3B or ;.
Below is the original, encoded and decoded versions.
This tab is in the way;
This+tab%09is+in+the+way%26semi%3B
This tab is in the way;
I recall that this is a change from earlier MT versions where %20 was used for space and something else was used for the ; which had an intentional duplication when encoding, or maybe that was with form submissions which also does encoding to pass data in a URL compatible format.
aliasmask wrote:Encode will change non alphanumeric characters in to %[hex value in ascii] except for the space which is a + symbol and the semi-colon is %26semi%3B or ;.
Below is the original, encoded and decoded versions.
This tab is in the way;
This+tab%09is+in+the+way%26semi%3B
This tab is in the way;
I recall that this is a change from earlier MT versions where %20 was used for space and something else was used for the ; which had an intentional duplication when encoding, or maybe that was with form submissions which also does encoding to pass data in a URL compatible format.
FYI: IF you want to live on the bleeding edge, my fork does have a sendURL(url, key, value) macro in it (as well as a requestURL(url)). It does a POST with the key/value pair, useful to package up json data and send it.
I only suggest it, as it seems you are developing something a little advance and may not care about staying with the normal builds.