Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 158 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

During my experiments with links to the charts I noticed that the resulting links in Data Explorer are truncated after 380 characters.

Try the following query:

SELECT '|Chart'

The resulting url truncates at %7Cmultithr point, also link name (Chart) is not applied.


After deploy the truncation is still present. I've checked the query.js source and found the following:

function encodeColumn(s) {
    if (s != null && s.replace != null) {
        s = s.replace(/[\n\r]/g, " ")
              .replace(/&(?!\w+([;\s]|$))/g, "&")
              .replace(/</g, "&lt;")
              .replace(/>/g, "&gt;")
              .substring(0, 400);
        return s;
    } else {
        return s;

I guess that substring(0, 400) should be removed or changed to something more democratic, e.g.: substring(0, 8000).

share|improve this question
And you think 380 characters is...not enough? – jadarnel27 Jan 10 '12 at 21:03
@jadarnel27 Well, it may not be enough for the links to Google Charts (check the linked feature-request for details). Of course there could be some behind-the-scenes reasons for the limit… Let's wait for devs reply. – Idolon Jan 10 '12 at 21:43
Indeed, my mistake. Good catch! – jadarnel27 Jan 10 '12 at 21:50
fixed and deployed – waffles Jan 10 '12 at 22:51
@waffles The link from my test query is still truncated at multithr part. Check my updated post: there is substring(0, 400) in encodeColumn function. – Idolon Jan 10 '12 at 23:30
@Idolon can you try again – waffles Jan 10 '12 at 23:48
@waffles Ok, it's not truncated now, but & in the URL is replaced with &amp (shouldn't there be semicolon at the end?). Check it here: this should create a link to but creates to instead. – Idolon Jan 11 '12 at 0:25
@Idolon yeah, Tim is looking into it and possibly posting a related SO question – waffles Jan 11 '12 at 0:28
@waffles Thanks. It's almost 3am here so I guess I'll read Tim's question tomorrow morning ;) Just FYI: after last change it's also impossible to add | in the URL as %7C since it is replaced with %257C (vertical line symbol is used in Google Charts URLs). Updated test query accordingly. – Idolon Jan 11 '12 at 0:54
up vote 3 down vote accepted

Yeah, the encodeColumn() function was being called a little too early on values that ended up being autolinked. I've patched the relevant code, so hopefully this will be fixed whenever waffles next gets a chance to deploy.

share|improve this answer
did you yank latest from main prior to patching? – waffles Jan 10 '12 at 21:58
Yep, hot off the presses. Should be based off your most recent commit, as of ten or so hours ago I believe. – Tim Stone Jan 10 '12 at 21:59
cool, feel free to fix any bugs you see, the data model has changed a bit. it is basically a mirror of gist. – waffles Jan 10 '12 at 22:00
Will do. And yeah, I glanced over the revisions and it's much, much better now. – Tim Stone Jan 10 '12 at 22:03
@TimStone As I understand the issue is substring(0, 400) at line 891 – Idolon Jan 10 '12 at 23:22
@Idolon Yeah, another deploy is going out that should address this, give it a few minutes. – Tim Stone Jan 10 '12 at 23:47
@TimStone Thanks for the fix - works like a charm now. – Idolon Jan 16 '12 at 13:10
@Idolon Good stuff. Sorry for the delay; your specific problem was easy enough to resolve, but there was a more general issue of whether or not we should try and encode the URL for you (which caused double-encoding in your example). – Tim Stone Jan 16 '12 at 13:17
@TimStone NP, I followed your progress in Mercury and was aware that encoding issue wasn't so simple to resolve. – Idolon Jan 17 '12 at 11:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .