How to encode/decode URLs ...

Hello,
I wanted to send an entire URL as parameter to a Stored Procedure.
How can I encode/decode this URL?
Thanks
Madhav

I don't know of an encoder, but IBM alphaWorks has a decoder:
http://www.alphaworks.ibm.com/tech/mpeg-4

Similar Messages

  • How to encode request url

    String szUsrName="venkat & ashique";
    <a href="javascript :
    window.open(../jsp/Customer.jsp?cust_name=<%=szUsrName%">)">
    </a>
    Request URL:=> Customer.jsp?cust_name=venkat & ashique
    --I think from ashique it is taking as another req parameter.
    but in Customer.jsp the request parameter value comming as '''venkat''' iwant to get whole String venkat & ashique. What is the problem i know.Problem is in the string '&' symbol is there.But the solution i dont know plz can u help me. How to encode that url</a>

    You need to escape non-alphanumeric characters with %XX where XX is the hexadecimal value for that character. For example:
    "venkat & ashique" => "venkat%20%26%20ashique"%20 is space and %26 is the &.

  • How to encode entire url

    hi,
    I want to know how can i encode url. Provide me code if u can.
    thanks

    thanks for reply
    here something, that i have tried pls check the code
    example.jsp
    <%
    String Login_Id = request.getParameter("Login_Id");
    String Pwd = request.getParameter("Pwd");
    String url = URLEncoder.encode("example2.jsp?Login_Id=" + Login_Id + "&Pwd=" + Pwd );
                   %>
                        <FORM name="form" ACTION="<%=url%>" style="margin-bottom: 0px" onsubmit="return check(this)">
         <TABLE border="0" align="center">
         <TR>
                                  <TD><B>Login Id:</B></TD>
                                  <TD><INPUT TYPE="text" NAME="Login_Id" style="border: 1px solid #800000"></TD>
                                  <TD><FONT SIZE="" COLOR="#D20000">*</FONT></TD>
         </TR>
         <TR>
                                  <TD><B>Password:</B></TD>
                                  <TD><INPUT TYPE="password" NAME="Pwd" style="border: 1px solid #800000"></TD>
                                  <TD><FONT SIZE="" COLOR="#D20000">*</FONT></TD>
         </TR>
         <TR>
                                  <TD colspan="2" align="right"><INPUT TYPE="submit" value="go.">
    </TD>
    </TR>
    </TABLE>
    </FORM>
    example2.jsp
    <HTML>
    <HEAD>
    <TITLE> New Document </TITLE>
    </HEAD>
    <BODY>
    welcome, <%=request.getParameter("Login_Id")%>
    </BODY>
    </HTML>
    here i want to encode url along with queryString.

  • How to encode short urls to long

    Hi community,
    Is there a way, to encode a short url like http://myServer:50000/irj/portal?NavigationTarget=navurl://b3d6d9ebac16a46574d62757803b05d4 to a long one like http://myServer:50000/irj/portal?NavigationTarget=ROLES://portal_content/every_user/general/eu_role/com.sap.portal.portal_personalization/com.sap.portal.persoUserMapping?
    I want to keep the short urls for the navigation, however I have a issue where I need to get some infos that I can only find in the long url.
    Thanks!
    Edited by: Harald Falzberger on Mar 31, 2011 3:19 PM

    check this :
    http://www.sap-basis-abap.com/sapac002.htm
    this apply to PM orders too

  • How to encode URL parameters in pl/sql?

    How to encode url and its paramters in PL/SQL to call a page using html GET method? Is there any equiavlent method of java's URLEncoder.encode() method in pl/sql (in any web packages) ?
    Any help/pointers highly appreciated.
    P.S. : URGENT PLEASE!!!

    http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:371959198986

  • How to encode URL in UTF-8 Using PL/SQL

    Hello,
    Platform:Oracle 9i, Sun Solaris,
    Using Oracle 0i XML/XDK Iam able to generate xml data and post it to url via HTTP POST. But the xml data need to be encoded in utf-8. Does anyone know how to encode the xml data within PL/sql ?
    Thanks for your time
    Seema

    Thanks for the suggestion. I like this approach as Java is more familiar to me than other languages.
    Our DBA is out of touch today, so I could not grant the javauserpriv to my database user. I tried to run the script anyway in the chance that my user had the privs, and it seemed to have hung. I am now combing Oracle's site for more documentation so I can write some tests to see if I can get a basic Java object working. Under what heading would I find this?
    ajt

  • Code for URL Encoder-Decoder!!!

    This is the code to Encode and Decode URL...Any suggestions on this are welcome...
    public class UrlEncoderDecoder
    public UrlEncoderDecoder()
    // TODO: Add constructor logic here
    // http://www.infysolutions.com
    public static string TamperProofStringEncode(string value, string key)
    System.Security.Cryptography.MACTripleDES mac3des = new System.Security.Cryptography.MACTripleDES();
    System.Security.Cryptography.MD5CryptoServiceProvider md5 = new System.Security.Cryptography.MD5CryptoServiceProvider();
    mac3des.Key = md5.ComputeHash(System.Text.Encoding.UTF8.GetBytes(key));
    return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(value)) + '-' + Convert.ToBase64String(mac3des.ComputeHash(System.Text.Encoding.UTF8.GetBytes(value)));
    public static string TamperProofStringDecode(string value, string key)
    string dataValue = "";
    string calcHash = "";
    string storedHash = "";
    System.Security.Cryptography.MACTripleDES mac3des = new System.Security.Cryptography.MACTripleDES();
    System.Security.Cryptography.MD5CryptoServiceProvider md5 = new System.Security.Cryptography.MD5CryptoServiceProvider();
    mac3des.Key = md5.ComputeHash(System.Text.Encoding.UTF8.GetBytes(key));
    // http://www.infysolutions.com
    try
    dataValue = System.Text.Encoding.UTF8.GetString(Convert.FromBase64String(value.Split('-')[0]));
    storedHash = System.Text.Encoding.UTF8.GetString(Convert.FromBase64String(value.Split('-')[1]));
    calcHash = System.Text.Encoding.UTF8.GetString(mac3des.ComputeHash(System.Text.Encoding.UTF8.GetByte s(dataValue)));
    if (storedHash != calcHash)
    throw new ArgumentException("Hash value does not match");
    catch
    throw new ArgumentException("Invalid TamperProofString");
    return dataValue;

    Ritu,
    Split the webpage into two frames.
    Frame1: Dropdown that you will dynamically populate. This will have to be coded using http://help.sap.com/saphelp_nw04/helpdata/en/09/9c0e41a346ef6fe10000000a1550b0/content.htm.
    Next insert java script into your page so that when one of these links is selected, specifically the onChange event, the other frame gets refreshed with the webpage that you would like to have. This page gives a good example of onChange.
    http://docs.sun.com/source/816-6408-10/checkbox.htm
    Best.
    Sumit.

  • Does CF really auto-decode URL parameters passed to a page?

    CF docs and livedocs state that:
    quote:
    ColdFusion automatically decodes URL parameters that are
    passed to a page
    (for example, see the URLEncodedFormat tag description, last
    sentence of opening paragraph)
    However, if you have a url-encoded url parameters, as in
    ?var1=1%26var2=2 (%26 is url-encoded equivalent of &), and in
    your page you try to validate url parameters with <cfparam
    type="integer" name="url.var1"> or with isvalid("integer",
    url.var1) function, the validation will fail! Apparently, inside at
    least this tag and function Cf does not automatically decode url
    parameters... it sees the var1 declaration, but sees its value to
    be not 1, but 1&var2=2, which surely fails validation against
    type "integer"....
    This behaviour has been brought up in these forums several
    times now, but nobody has been able to explain how this relates to
    the CF docs statement... Any ideas, anyone? Is this an expected
    behaviour? Are the docs wrong? Does 'parameter', as in "url
    parameters", refer only to specific parts of query string and does
    not include url var name/value pairs separator? Apparently the same
    happens if you have "=" sign url-encoded, too...

    I will have to think on this, do some reading and try some
    experiments.
    But my first thought is that this is expected behavior. I
    would
    propose the purpose of URL encoding the ampersand(&) is
    so that it will
    be considered a part of a value, not its usual role of
    name-value pair
    separator. So in my mind this is the way it is supposed to
    work.
    val1=1&val2=2 : val1 is 1 and val2 is 2
    val1=1%26var2=2 : val1 is '1&var2' or '1&var2=2'
    I will have to explore this further.

  • Simple and very fast encoder-decoder

    I will explain my need with an example;
    www.domain.com/photo.jsp?id=23
    here id is 23 and people can try every photo by incresing or decreasing the id number. I want to encode the id's while printing the id to screen as url and will decode everytime when i get the request from user.
    So i need a very fast and simple logic of encode & decode. I have tested base64 at java but everyone knows the algortihm. Is there any other simple algorithm that i can generate on my own?
    What do you advice to me except changing my database and search with hex keys?

    believe me its strictly
    needed on a photo web site... there are too much
    reasons.I can't think of one.1)when ids are sequantial on db users can get the idea which after or before this photo is uploaded
    2)when you see the normal integer numbers on ids you can remember it easily and edit the link by hand and see whats going on...
    3)When u see user_id is=1 u can understand easily that he is an admin or one of the first member of website
    4)when u try the maximum photo id or user id every user can understand how many user or photos are there in website
    there are lots of things like above... They may be not that valueble for everyone but i think this have to be.

  • How to assign a URL in the Tabular Form

    Hi,
    I am using the htmldb.item api's to create manually,the Tabular form. I have got a column in the database(View) like
    ''||substr(DESCRIPTION,1,30)||decode(substr(DESCRIPTION,30,1),null,null,'...')||'' DESCRIPTION,
    which displays as a URL and when the user clicks this URL, the page will have a popup page(in this case it is redirected to page 52).
    My probelm is , if I use wwv_flow_item.display_and_save for this column, I dont see the URL, but it displays the above entire string (along with the HTML tags).
    If I do not use wwv_flow_item.display_and_save, I can not use this item in the COllections as I am using the some validations to display an Error message (Inline with field and in Notification)
    I cannot display the Validation error in the - On Error Page as I should prevent the user to use the browser buttons
    Please let me know how to display the URL and to have this information in the Collection
    TIA
    Ravi

    Ravi,
    Can you fetch the column twice, once into a non-escaped display type that does not generate a form item and again into a hidden item for your collection?
    Scott

  • How do you harness URL external application in a JSP?

    I have successfully deployed the Yahoo Finance sample URL External Application. However, I do not understand how to utilize the URL classes (in the pdkjava.jar) to harness the external application information once a user has authenticated. I am building a JSP portlet that displays and applet, however the applet requires a username and password. I need to get the Username and Password from external application, which it gets from the user via External Application. How do I get these values in my JSP (that is defined in my provider.xml)? I keep seeing documentation regarding the ExternalPrincipal object however I don't understand how to utilize this object in my JSP. I beleive the ExternalPrincipal object is what I need in my JSP, seeing that it has the methods for getting the user and password. Unless is there a better way of achieving this, can anyone shed some light on getting the ExternalPrincipal object for an External Application session?
    Thanks,
    Laith E.H.

    Thanks for the example. I have a better understanding now, however I'm still having trying to comprehend the flow of executing in this portal model.
    I have a problem with:
    PortletRenderRequest pr = (PortletRenderRequest) request.getAttribute("oracle.portal.PortletRenderRequest");
    ProviderUser prUser = pr.getUser();
    ProviderSession pSession = prUser.getSession(true);
    I get a NullPointerException on the second line when trying to getUser(). I'm not sure where the problem could be. In the provider.xml, my ExternalProviderInstance, or the JSP itself? I have another JSP portlet on the same page that calls the same method with success.
    Thanks,
    Laith E.H.
    provider.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <?providerDefinition version="3.1"?>
    <provider class="oracle.portal.provider.v2.http.URLProviderDefinition">
         <providerInstanceClass>com.cox.portal.provider.ExternalProviderInstance</providerInstanceClass>
         <session>true</session>
         <authentication class="oracle.portal.provider.v2.security.Authentication">
              <authType>ExternalApp</authType>
              <userFieldName>Username</userFieldName>
              <userPwdName>Password</userPwdName>
              <errorPageMessages>Invalid ID,Invalid Password</errorPageMessages>
         </authentication>
         <portlet class="oracle.portal.provider.v2.http.URLPortletDefinition">
         <id>1</id>
         <name>ExternalAnalyzer</name>
         <title>Main Analyzer</title>
         <description>This portlet logs into analyzer</description>
         <timeout>100</timeout>
         <timeoutMessage>analyzer timed out</timeoutMessage>
              <showEdit>false</showEdit>
              <showEditDefault>false</showEditDefault>
              <showPreview>false</showPreview>
              <showDetails>false</showDetails>
              <hasHelp>false</hasHelp>
              <hasAbout>false</hasAbout>
              <acceptContentType>text/html</acceptContentType>
              <registrationPortlet>false</registrationPortlet>
              <accessControl>registered</accessControl>
              <renderer class="oracle.portal.provider.v2.render.RenderManager">
                   <showPage class="oracle.portal.provider.v2.render.http.URLRenderer">
                        <pageUrl>http://catl0dv31.corp.cox.com/bic/analyzerIFrame.jsp?ap_doc=analyzer&amp;ap_id=105</pageUrl>
                        <contentType>text/html</contentType>
                   </showPage>
              </renderer>
              <securityManager class="oracle.portal.provider.v2.security.URLSecurityManager">
                   <authorizType>registered</authorizType>
              </securityManager>
         </portlet>
    </provider>
    ExternalProviderInstance:
    package com.cox.portal.provider;
    import oracle.portal.provider.v2.*;
    import oracle.portal.provider.v2.http.*;
    import oracle.portal.provider.v2.externalApp.*;
    public class ExternalProviderInstance extends URLProviderInstance
    public static final String EXTERNAL_APP = "externalapp.object.key";
    ProviderSession pSession = null;
    public Object[] initSession(ProviderUser user, ExternalPrincipal externalApp)
    throws ProviderException {
    //UrlServicesUtils.logMessage("BasicURLProvider : Entering initSession.", getDebugLevel());
    //Create/Retrieve provider user session.
    if (mProviderDefinition.getHasSession()) {
    // Create the session if it doesn't already exist.
    pSession = user.getSession(true);
    // Store external app in provider session so that other modules
    // can extract it later.
    if (pSession != null) {
    pSession.setAttribute(EXTERNAL_APP, externalApp);
    // Get javax.servlet.http.Cookie[] from user
    javax.servlet.http.Cookie[] cookies = ((ServletProviderUser)user).getCookies();
    if(cookies != null)
    return cookies;
    else
    return null;

  • SharePoint Search encodes the URL incorrectly when there are special characters in a filename on a file share

    In our Sharepoint Server 2013 CA, Search Administration, Content Sources, we have configured a File Share Content Source.
    Search queryes works fine and it returns relevant documents from the file share content source.
    But when click on a file with a filename that contains special characters like "ÁÝÚÍÓÐ", Sharepoint encodes the link to the file incorect, and when we click on the link to the file, it throws an error on the screen saying "This
    page can’t be displayed".
    The following picture shows an example on how Sharepoint shows encodes the URL to a file with a special character in the filename:
    As you can see, the link to the file is
    \\xserver1\felagstest\Kompliserað\Ólavur.pdf, but when I hoover over the file, it translates og encodes this to
    \\xserver1\Felagstest\Kompliserað\Ólavur.pdf. If I manually type the correct link in the address field in Internet Explorer then it works.
    What is the problem here, and more importently what is the solution to this problem?

    This is solved in the Hotfix KB 2899469 for SharePoint Server 2013 October 14, 2014:
    http://blogs.technet.com/b/stefan_gossner/archive/2014/10/14/october-2014-cu-for-sharepoint-2013-has-been-released.aspx
    I installed the http://support2.microsoft.com/kb/2899469 hotfix, and now I can search and open files on external file shares with path and filenames containing non-US-ASCII characters,
    without getting "This page can’t be displayed".
    Where in the description of this hotfix is written, that it solves the encoding issue?

  • Base 64 Encode/Decode

    I consider sending clear text problematic when the data ends
    up as XML information. Converting the text Strings to Base 64
    between PHP and Flex 2 (or anything else and Flex 2) eliminates
    issues with character text like <> and &'s. I've done a
    lot of XMLRPC coding and always sent text data values that are Base
    64 format. The built in Flex 2 Base 64 functions make this easier.
    On the PHP side, you can use
    $b64StringVal = base64_encode ( $stringData );
    $stringData = base64_decode ( $b64StringVal );
    to convert.
    If you are using Java at th back end, look at:
    http://iharder.sourceforge.net/current/java/base64/
    Definitions in the CDATA area:
    import mx.utils.Base64Encoder;
    import mx.utils.Base64Decoder;
    import flash.utils.ByteArray;
    public function encodeB64(target:String) : String
    var be:Base64Encoder = new Base64Encoder();
    be.encode(target);
    var encodedData:String = be.flush();
    return encodedData;
    public function decodeB64(target:String) : String
    var bd:Base64Decoder = new Base64Decoder();
    bd.decode(target);
    var decodedData:ByteArray = bd.drain();
    return decodedData.toString();
    [Bindable] public var myData:String = new String();
    private function loginResult(evt:ResultEvent):void {
    var b64MyData:String = evt.result.MyData;
    myData=decodeB64(b64MyData);
    In the mxml area:
    <mx:HTTPService id="loginPage" url="
    http://localhost/xxx.php"
    useProxy="false" method="POST" />
    <mx:Model id="loginModel1">
    <root>
    <loginModel>"loginModel1"</loginModel>
    <username>{encodeB64(username.text)}</username>
    <password>{encodeB64(password.text)}</password>
    </root>
    </mx:Model>

    Hello jlmoller,
    Have you ever had an issue where the encoding / decoding
    process ended up prepending the string with extra characters?
    This is happening to me
    Erik

  • Encode/Decode string from unix shell

    Hi,
    I am not sure I'm addressing my question properly, but simply I have a stream where I send commands to a shell and when these commands come back from the input stream they don't mean anything as shown below:
    inc show int status | inc |1/7|1/17|1/19|1/^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H$atus | inc show int status | inc |1/7|1/17|1/19|1/1 ^H^H^H^H^H^H^H^H^H8|1/6|1/8^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H show int status | inc |1/7|1/17|1/19|1/18|1/6|1/8| ^H^H^H^H^H^H^H^H^H1/16|1/15^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^Hstatus | inc |1/7|1/17|1/19|1/18|1/6|1/8|1/16|1/15| ^H^H^H^H^H^H^H^H^H1/13|1/14^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^Hnc |1/7|1/17|1/19|1/18|1/6|1/8|1/16|1/15|1/13|1/14| ^H^H^H^H^H^H^H^H^H1/12|1/11^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H17|1/19|1/18|1/6|1/8|1/16|1/15|1/13|1/14|1/12|1/11| ^H^H^H^H^H^H^H^H^H1/9|1/10
    I am using the utf-8 for encoding...do I need to decode it and how?
    Here is part of my code:
    OutputStreamWriter writer = new OutputStreamWriter(sess.getStdin(), "utf-8");
    writer.write("my string");
    writer.flush();
    class StreamGobbler implements Runnable {
            InputStream is;
            OutputStream oi;
            String type;
            ResultBean resultBean;
            StreamGobbler(InputStream is, String type, ResultBean returnValue) {
                this.is = is;
                this.type = type;
                this.resultBean = returnValue;
            @Override
            public void run() {
                try {
                    InputStreamReader isr = new InputStreamReader(is, "UTF-8");
                    BufferedReader br = new BufferedReader(isr);
                    String line = null;
                    while ((line = br.readLine()) != null) {
                        //System.out.println("TYPE[" + type +  "] COMES FROM STD_OUT THREAD: " + line);
                        this.resultBean.addResultLine(line);
                        this.resultBean.addMessage(line);
                } catch (IOException ioe) {
                    System.out.println("IOE Exception in StreamGobbler");
                    ioe.printStackTrace();
        }Thanks in advance, i never dealt with encoding/decoding text.

    kminev wrote:
    I am pretty sure it is an encoding issue, I'm not convinced because ^H is the ASCII backspace character. Maybe not as I originally thought just some padding but it looks like some form of formatting done the old fashioned way using control characters.
    because if I also send this output in an email format and the email renders it a bit differently, then if I copy and paste the text to html page and render it on the screen it look as it is suppose to be.It's definitely not HTML so this does not seem logical.
    >
    Here are the ios commands I am issuing:
    show int status | inc |gi1/2|gi1/3|gi1/5
    then I send an empty string to the shell so if there is more prompt I see all the outputted values.
    Does that help in any way?
    ThanksSorry I can't help.
    Bye

  • Issue: Characters / encode /decode & Solution

    Hey guys,
    Few issues on this, I think we will need an encode/decode filter.
    I guess this is related to how if you read a cookie in liquid it converts characters like a comma into its entity (This isn not fixed yet).
    Example:
    <meta property="og:description" content="{{description | strip_html | truncate:200,'...' }}">
    The resulting markup is:
    <meta property="og:description" content="Seven advisers within National Australia Bank's (NAB) salaried advice business, NAB Financial Planning (NAB FP), have transitioned to the bank&rsquo;s newly-launched self-employed model.
    As first ...">
    You can see it has stripped out the html markup but has encoded a ' with it's entity. I can see in some cases this is good but in other cases this is bad. You can also see that <br/> while stripped are treated as new lines instead.
    Liquid itself for these reasons have:
    escape - escape a string
    escape_once - returns an escaped version of html without affecting existing escaped entities
    strip_html - strip html from string
    strip_newlines - strip all newlines (\n) from string
    newline_to_br - replace each newline (\n) with html break
    You only have strip_html but not the other filters. I think if you implemented these then we can address these issues.

    Hi Liam,
    The encoding problem cannot be reproduced. Even in your example, some of the quotes are outputted correctly while a single one not. Can you edit the source of the content and try to re-enter the character from the editor, just to eliminate a possible copy / paste issue from word with a weird character encoding?
    On the new line issue, it seems to happen on some scenarios. For example:
    {{" <div>Seven advisers within National Australia Bank's (NAB) salaried advice business, NAB Financial Planning (NAB FP), have transitioned to the bank's newly-launched's self-employed <br /> model. at first's</div>" | strip_html }} - does not reproduce the problem
    <meta property="og:description" content="{{" <div>Seven advisers within National Australia Bank's (NAB) salaried advice business, NAB Financial Planning (NAB FP), have transitioned to the bank's newly-launched's self-employed <br /> model. at first's</div>" | strip_html }}”> - does reproduce the problem
    Cristinel

Maybe you are looking for