Qlik Community

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
WE ARE LISTENING! New Navigation for Qlik Community, Sept. 26: TELL ME MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Sai_Mohan
Contributor III
Contributor III

Qlik sense is converting '%' into '%25 ' for URL when it gets redirected

Hi All,

I am getting this issue like all the special characters are changing while redirecting to the browser.

For Example:

Assume I have a link  mywww.goo%le.com , when it gets redirected to browser, '%' is converted itself to '%25'.

Please help with some solution.

Note: I am getting that URL Data from SQL server.

 

Thanks,

Sai

Labels (1)
6 Replies
QlikTom
Employee
Employee

This may be because '%' is not a valid URL character. 

Valid URL Characters

There are relatively few valid characters in a URL: uppercase and lowercase letters of the alphabet; digits “0” through “9”; special characters: dash, underscore, period, exclamation point, asterisk, apostrophe and opening and closing parentheses; and reserved characters: percent sign, dollar sign, ampersand, plus sign, comma, forward slash, colon, semi-colon, equal sign, question mark and “@” symbol. All other characters must be encoded using a percent sign and their assigned hexadecimal numbers. Reserved characters, such as the percent sign, are only valid to indicate special meaning, and they must be encoded when they are used without their special meaning. For example, to include a percent sign in a URL, you must encode it as “%25.”

https://www.fullhost.com/blog/what-does-20-mean-in-a-web-address/

https://krypted.com/utilities/html-encoding-reference/

If you go to google and search for % you will notice the generated URL has the query parameter listed like so:

https://www.google.com/search?q=%25

(you have to look for it as google will include several other parameters, but you are looking for "q=" )

Sai_Mohan
Contributor III
Contributor III
Author

Thanks For Replying @QlikTom!

Is it Qlik Issue or HTML Encode Issue? . Because I got that URL Column from Html. 

So everyone is telling it like qlik Issue, Becoz If I try manually, Copying that URL to a browser then it is working, But error comes, when I directly click on that URL From My Qlik Report.

Is it doable in Qlik Sense?

Thanks In Advance  

QlikTom
Employee
Employee

I am going to assume you are using URLs in a table chart:

In my testing, Qlik Sense will convert special characters to their appropriate HTML entity code if the entity code is not used in the data and pass along the URL as-is if it is used in the data. 

That is to say, both the links in the example below, produce the same result when a new tab opens. 

This is typically not an issue as doing otherwise would produce an invalid URL. 
As far as I know, there is no domain name with a '%' sign it it such as your example, so there may be a specific context I am missing. 

QlikTom_0-1593713309355.png

result of clicking Key #1 or Key #2

QlikTom_0-1593714118668.png

 

 

QlikTom
Employee
Employee

Side note:

The issue may not be the conversion of the HTML entity.
If I do not include the protocol (http:// or https://)

like so:
www.google.com/search?q=%

Qlik will assume http://

This is fine for google, as it automatically redirects http:// to https://

This is not necessarily true of all domains. It has to be configured to do so.

Based on your description, that likely is not your issue, but it may be for some.   

Sai_Mohan
Contributor III
Contributor III
Author

Thanks For Replying @QlikTom 

I have different URL, which is confidential so I am unable to share with you.

In the middle of the URL, we have NAME like ' Sample%2352'.   Here, That name is getting converted to 'Sample%252352'.

So,  People think there is issue with Qlik report and asked me to do change that and try to get solution for that.

Please let me know, Is there any other solution for this.

 

Thanks 

Sai

QlikTom
Employee
Employee

As far as I know, there is no way to override that behaviour.

This is, arguably,  for good reason. If you click on one of the links below you will see what happens to your sample value if '%' symbols are not correctly encoded. 

%23 happens to be the HTML Entity code for a '#' symbol. 

Bing Test:
https://www.bing.com/search?q=Sample%2352

QlikTom_0-1593774469436.png

 

Google Test:
https://www.google.com/search?q=Sample%2352

QlikTom_1-1593774501538.png

Looking at the results, it may be the issue is that your URL is already HTML encoded in the datasource.
In that case, we are running into a double encoding situation. 

There is an easy fix if this is the problem! Just use MapSubString to do a find and replace in the load script to remove HTML Entity Codes.

 

 

//HTML Entity mapping table
HTML_map:
mapping load * inline [
MatchField,ReplacementValue
%23,#
];

//use MapSubString Function to replace HTML Entity Codes
Load
	MapSubString('HTML_map',[YourUrlField]) as URL,
....