What exactly characters does htmlencode( convert


#1

Does htmlencode( strip out tab()?

I am posting from Panorama X to Panorama 6 Enterprise database and it is losing the tab() that is used in an array.


#2

It doesn’t strip it out, but it doesn’t encode it either.

39%20PM

urlencode( doesn’t encode it either. The URL encoded version of a tab would be %09. Posted data is usually url encoded, not html encoded.


#3

I assume you are talking about htmlencode( in Panorama X, not Panorama 6. In Panorama X, this function is implemented as a custom function, I’ve provided the source code below. As Dave discovered by experimentation, it does not do anything with the tab character.

In HTML, any sequence of white space characters is treated as a single space. Spaces, carriage returns, tabs, etc. all collapse to a single space. So normally tab characters would not be included in HTML text. As far as I know, there is no encoding for tab in HTML. HTML renderers (i.e. web browsers) don’t have any concept of “tabbing”, other than by using <table>, <tr> and <td> tags.

All this leaves me wondering, why are you encoding as HTML to transfer from Panorama X to Panorama 6? HTML is a format for displaying in a web browser, not for transfer between programs. If you eventually want to display whatever data you are passing to a web browser, I would recommend doing the encoding on the Panorama 6 server as the web page is generated. And there shouldn’t be any tab characters involved at that point. If you want to display a table in HTML, use the htmlarraytable or htmldatatable to convert the data to an HTML table using <table>, <tr> and <td> tags. I supposed if you wanted to do this conversion in advance on Panorama X and pass pre-generated HTML to Panorama 6, you could do that, since those statements are already included in Panorama X. But there should never be tab characters in HTML text.


Here’s the source for the htmlencode( function:

/* iso8859-1 generator */
characterfilter(thetext,|||switch(import(), {‘},{'}, {’},{'}, {”},{"}, {“},{"}, {&},{&amp;}, { },{&nbsp;}, {¡},{&#161;}, {¢},{&#162;}, {£},{&#163;}, {€},{&#164;}, {¥},{&#165;}, {|},{&#124;}, {§},{&#167;}, {¨},{&#168;}, {©},{&copy;}, {ª},{&#170;}, {«},{&#171;}, {¬},{&#172;}, {–},{&#173;}, {®},{&reg;}, {¯},{&#175;}, {˚},{&#176;}, {±},{&#177;}, {´},{&#180;}, {µ},{&#181;}, {¶},{&#182;}, {•},{&#183;}, {¸},{&#184;}, {º},{&#186;}, {»},{&#187;}, {¿},{&#191;}, {À},{&Agrave;}, {Á},{&Aacute;}, {Â},{&Acirc;}, {Ã},{&Atilde;}, {Ä},{&Auml;}, {Å},{&Aring;}, {Æ},{&AElig;}, {Ç},{&Ccedil;}, {È},{&Egrave;}, {É},{&Eacute;}, {Ê},{&Ecirc;}, {Ë},{&Euml;}, {Ì},{&Igrave;}, {Í},{&Iacute;}, {Î},{&Icirc;}, {Ï},{&Iuml;}, {Ñ},{&Ntilde;}, {Ò},{&Ograve;}, {Ó},{&Oacute;}, {Ô},{&Ocirc;}, {Õ},{&Otilde;}, {Ö},{&Ouml;}, {Ù},{&Ugrave;}, {Ú},{&Uacute;}, {Û},{&Ucirc;}, {Ü},{&Uuml;}, {ß},{&zslig;}, {à},{&agrave;}, {á},{&aacute;}, {â},{&acirc;}, {ã},{&atilde;}, {ä},{&auml;}, {å},{&aring;}, {æ},{&aelig;}, {ç},{&ccedil;}, {è},{&egrave;}, {é},{&eacute;}, {ê},{&ecirc;}, {ë},{&euml;}, {ì},{&igrave;}, {í},{&iacute;}, {î},{&icirc;}, {ï},{&iuml;}, {ñ},{&ntilde;}, {ò},{&ograve;}, {ó},{&oacute;}, {ô},{&ocirc;}, {õ},{&otilde;}, {ö},{&ouml;}, {÷},{&#247;}, {ù},{&ugrave;}, {ú},{&uacute;}, {û},{&ucirc;}, {ü},{&uuml;}, {ÿ},{&yuml;}, import())|||)

#4

I am actually posting data from Panorama X to Panorama 6 Enterprise using posturl. I was not doing anything special with posturl, just the

posturl vcgiResults, vUrl, “Search”, SlipInvNo, etc, etc,.

The result on Enterprise Server was %09. I have been interacting with Enterprise Server and Panorama X for many months and I have not seen this happen before. Any way, I just did a simple replace( to change the %09 to a tab() and all seems good.


#5

I wondered if that was what you are doing. Data passed via HTTP POST (which is what posturl does) should NOT be HTML encoded, unless it is supposed to be HTML. However, there is encoding involved in the HTTP POST protocol, so I think that is what you are encountering. What you’ve done, using the replace( function, should be fine.

Note that HTTP and HTML are different things, even though both are part of “web technology” in general.

HTTP (Hyper Text Transport Protocol ) is the underlying protocol used by the World Wide Web and this protocol defines how messages are formatted and transmitted, and what actions Web servers and browsers should take in response to various commands.

HTML (Hyper Text Markup Language) is the language used to create Web pages for display in Web Browsers.

So HTTP is how browsers and servers communicate, HTML is how browsers display information.