distal-attribute
distal-attribute
distal-attribute
distal-attribute

HTML character transfer

User, date Message
Written by abes
1 year ago
Category: Import/Export
2 posts since Wed, 06 Mar 13
Using "Export grid rows->HTML table" of a view generated using the following code

CONCAT('<a href="', part.link, '"<', 'link', '></a>') AS 'Weblink'

generates a table line

<td class="col8"><a href="http://www.alliedelec.com/search/searchresults.aspx?dsNav=Ntk:Primary|203STBW|3|,Ny:True,Ro:0&dsDimensionSearch=D:203STBW,Dxm:All,Dxp:3&SearchType=0"<link></a></td>

where the <, > characters appearing in as <, > so the link does not work.

Please let me know your suggestions.
Thanks.
Written by abes
1 year ago
2 posts since Wed, 06 Mar 13
Unfortunately the browser rendered the characters right in the forum.

Again here are the converted <, > characters as the Notepad++ shows them & lt and & gt.
Written by ansgar
1 year ago
4988 posts since Fri, 07 Apr 06
Yes, such special characters are encoded by HeidiSQL, using their HTML entity representations. Normally you have non-HTML content in the cells, and when these contain < or >, that would break the exported table. The fact that you now have a situation in which you explicitly *want* these characters means you need a checkbox option. Something like "Encode special HTML characters", which you uncheck. Only I'm afraid another checkbox would start to overcrowd that simple dialog, doesn't it?
Written by kalvaro
1 year ago
594 posts since Thu, 29 Nov 07
HeidiSQL is doing it just fine:

<gt;

is the correct HTML representation of

<>

. It's not reasonable to expect that HeidiSQL or any other piece of software visually inspects your result set and decide that some arbitrary columns must be handled as raw HTML just because they have angle brackets.

BTW, running e.g. this:

SELECT CONCAT('<a href="', 'http://example.com', '"<', 'link', '></a>') AS 'Weblink'



... generates this:

<a href="http://example.com"<link></a>



... which is malformed HTML.
Written by ansgar
1 year ago
4988 posts since Fri, 07 Apr 06
Hehe, posted just 16 seconds one after the other :)
Written by kalvaro
1 year ago
594 posts since Thu, 29 Nov 07
P.S. Anse, since the forum software does not accept HTML tags at all, it should not treat strings that start with ampersand as HTML entities.
Written by ansgar
1 year ago
4988 posts since Fri, 07 Apr 06
Yes... that means entities need to be double encoded. Which again means currently entities are not double encoded, and that's a bit strange. Will check that.
 

Please login to leave a reply, or register at first.