Url encoding problem

I'm trying to URLDecoder.decode an url with accented characters, but it's not working:
For example with the "?" character:
    URLEncoder.encode("?","UTF-8"); results in: %C3%B6
However, when I URLDecoder.decode my url, (http://localhost/mjszotar/keres?szo=%C3%B6), the result is: ??
Can you help me find out the problem please?

I have tried with the Character Encoding option
URLDecoder.decode("http://localhost/mjszotar/keres?szo=%C3%B6","UTF-8");
output:
http://localhost/mjszotar/keres?szo=?
URLDecoder.decode("http://localhost/mjszotar/keres?szo=%C3%B6","ISO-8859-1");
output:
http://localhost/mjszotar/keres?szo=??

Similar Messages

  • Problem in URL Encoding  in J2ME

    Hi,
    I have a problem in URL Encoding in J2ME. As i read thru the J2ME APIs, i found that J2ME doesn't support it.
    Or can i use the URL Encoding in J2SE to modify and put into J2ME?
    Or someone out there have done such coding?
    Reply me!
    Thanks!...

    like this:
    public static String URLEncoder(String str) {
    if (str == null) return null;
    StringBuffer resultStr = new StringBuffer( str.length() );
    char tmpChar;
    for( int ix=0; ix<str.length(); ix++ ) {
    tmpChar = str.charAt( ix );
    switch( tmpChar ) {
    case ' ' : resultStr.append( "%20" );
    break;
    case '-' : resultStr.append( "%2D" );
    break;
    case '/' : resultStr.append( "%2F" );
    break;
    case ':' : resultStr.append( "%3A" );
    break;
    case '=' : resultStr.append( "%3D" );
    // System.out.println( "tmpChar = '=' " + "add %3D " );
    break;
    case '?' : resultStr.append( "%3F" );
    // System.out.println( "tmpChar = '?' " + "add %3F " );
    break;
    case '#' : resultStr.append( "%23" );
    break;
    case '\r' : resultStr.append( "%0D" );
    break;
    case '\n' : resultStr.append( "%0A" );
    break;
    default : resultStr.append( tmpChar );
    break;
    return resultStr.toString();
    }

  • Encoding problem in call-back to hook URL (post parameters)

    Hello all,
    I'm encountering a character encoding problem while retrieving the content of the shopping basket from one of our provider.
    After the POST request is made by the provider to our system using the hook url, when debbuging I can see that some special characters are represented with the sign '#' (after the call the ITS_IMPORT_CONTEXT).
    In our case using the parameter http_content_charset with various values, including UTF-8, did not change the result.
    Inspecting the HTTP traffic has highlighted the following: the encoding received from the provider is related to UTF-8, but while we are expecting the hexadecimal values, we are receiving the "Unicode code points", which are not recognized by our SAP system. For more details look at the UTF-8 encoding table found here and compare the values under column "Unicode code point" with the one under column "UTF-8 (hex.)".
    As an example, for the character 'é', we are receiving the value "%E9" (the code point) instead of receiving the the hexa value : "%C3%A9".
    Do you have any idee if this can be corrected on our side or if the provider must addapt the way it's sending the POST parameters?
    Many thanks in advance for you help.
    Best regards,
    Jerome.

    Hi Jason,
    Indeed I had contacted the provider and informed them about the encoding problem and the fact that passing the parameter http_content_charset had no effect on the sent back encoding.
    They have taken into account my request and have changed the encoding used during the request to the HOOK_URL.
    Thanks to all of your for your help.
    Regards,
    Jerome.

  • Hi, how to use URL encoding in jsp

    hi, how to apply URL encoding in jsp for a string, could u pls suggest some ideas to use URL encoding in jsp
    thank you in advance

    hi, thnx for the reply, but my problem is to use url encoding method
    i would u like to know how to represent in jsp program i have asp code some thing like this
    href='/project/tel_number.asp?team=<%=DbRecTeam("id")%>&name=<%=Server.URLEncode(DbRec("name"))%>'
    i would like to know how replace that Server.URLEncode stmt in jsp, could u pls suggest some equivalent method for the above stmt
    thanx in advance

  • XML to URL Encoded (XSLT?)

    I have some data in a Document object and need to convert it to URL encoded format so, for example this:
    <share>
    <code>GSK</code>
    <price>13.34</price>
    </share>
    becomes something like...
    &code=GSK&price=13.34& ...
    I've been looking into doing this with XSLT but have run into difficulties. Do you think this is the best way of solving this problem, or is there another easier way?
    Thanks.

    I did something similar, basically takes a incoming XML file and output a HTML with certain link containing XML element value as query string. One of the things you have to be careful is, like Dr. Clap mentioned, to properly encode the value. I accompolished by using java extension in my XSL.
    For example:
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
              xmlns:encode="java.net.URLEncoder"
              extension-element-prefixes="encode"
              version="1.0">
         <xsl:template match="/">
              <xsl:variable name="myURL" select="concat('?blah=', encode:encode($myValueFromXML))" >
         </xls:template>
    </xsl:stylesheet>

  • URL Encoding and UTF8

    Hello Friends,
    I have been working on this problem for some time now. I have a web page that has forms fields like first name, last name etc. and then posts the data back to a servlet that writes it into a file that is utf-8 encoded. The web page has charset specified as utf-8. I was assuming that data would be sent back in the url as utf-8. I entered some japanese data copied from a japanese web page. When I looked at the file into which the form data was written I saw that it wasn't even close to utf-8 or unicode encoding of the data I had posted. For eg. I entered a japanese character: '\u4F1A' which is utf-8 encoded as 'E4 BC 9A'. But the data written into the file is '25 45 34 25 42 43 25 39 41'. This is of course because the data is url encoded which is '%E4%BC%9A', since 45 is hex for E, 34 is hex for 4 and so on. Now the question is how is it that I proceed to get the right utf data back. I am using a jrun server. Is there something that I need to set here in order to get the right characters back.

    The UTF-8 encoded sequence of bytes of the character '\u4F1A' is {-E4, -BC, -9A}, and the character '-' is (char)0x2d instead of (char)0x25. And I suppose 25 should be 2d.

  • URL Encoder not working in Netscape

    Hi All,
    I am using url encoding in my servlet for redirecting a request. The query string values has some spaces in them. The code I have used is shown below
    String mname = "Jason Perry"
    response.sendRedirect
    ("http://194.216.8.238:8081/merchant/merch.merchant?msgid=RP&mctid=1111242&totcp="+price.toString()+"&mname="+URLEncoder.encode(mname)+"&mtxnid=UY675432");
    Please note that 194.216.8.238:8081 is an IP of another server located outside our network.
    In Netscape the url is shown as http://194.216.8.238:8081/merchant/merch.merchant?msgid=RP&mctid=1111242&totcp=15
    &mname=Jason Perry&mtxnid=UY675432
    The space is not getting replaced with the plus.
    But I have observed that if the redirection is to the same server on which the servlet is running, it works fine.
    I am at loss as to why url encode is not working when routing the request to another server. I am using Netscape 4.77 .
    This is works in IE fine.
    Your inputs are appreciated.
    Thanks
    Malini

    Yeah had this problem before, use the java.net.URLEncoder class:
    <%@ page language="java" import="java.net.URLEncoder"%>
    <%
    String url = "http://194.216.8.238:8081/merchant/merch.merchant?msgid=RP&mctid=1111242&totcp=15
    &mname=Jason Perry&mtxnid=UY675432"
    String encodedUrl = URLEncoder.encode(url);
    response.sendRedirect(encodedUrl);
    %>

  • Apache plugin url encoding

    the following is on HP Apache-based Web Server/1.3.26
    with the mod_wl.so from 6.1 sp3 proxying to a 6.1 sp3 backend and I tried setting
    up QueryFromRequest ON to no avail.
    I am having the following problem with the BEA proxy plugin for Apache. I have
    a very simply scenario to demonstrate it. Lets say that you have the following
    directory/file structure:
    /applications
         /DefaultWebApp
              spaceLink.htm
              /space demo
                   resource.htm     
    NOTE: There is a "space" in the "space demo" directory name.
    Now, spaceLink.htm has a link to the file resource.htm in the "space demo" directory.
    Here is the html:
    <html> <body> click here </body> </html>
    Now assume that apache is sitting in front of this BEA box and proxying requests
    to the BEA box.
    If the Apache-BEA proxy plugin is proxying the request to BEA, then the request
    is made correctly from the browser to the proxy as:
    GET /space%20demo/resource.htm HTTP/1.1
    Notic the browser is correctly URL encoding the request.
    BUT, the apache-BEA proxy plugin is incorrectly proxying the request to the BEA
    box:
    GET /space demo/resource.htm
    Notice the Apache-BEA proxy is not URL encoding the request, so when BEA gets
    it he thinks this is a request for "/space" and "demo/resource.htm" is the http
    version.
    This problem DOES NOT happen if I use the generic http proxy module provided with
    Apache.
    Has anyone seen this problem before?
    Please get back to me if you have some information.
    Thanks,
    Cole Crawford
    Paymentech

    the following is on HP Apache-based Web Server/1.3.26
    with the mod_wl.so from 6.1 sp3 proxying to a 6.1 sp3 backend and I tried setting
    up QueryFromRequest ON to no avail.
    I am having the following problem with the BEA proxy plugin for Apache. I have
    a very simply scenario to demonstrate it. Lets say that you have the following
    directory/file structure:
    /applications
         /DefaultWebApp
              spaceLink.htm
              /space demo
                   resource.htm     
    NOTE: There is a "space" in the "space demo" directory name.
    Now, spaceLink.htm has a link to the file resource.htm in the "space demo" directory.
    Here is the html:
    <html> <body> click here </body> </html>
    Now assume that apache is sitting in front of this BEA box and proxying requests
    to the BEA box.
    If the Apache-BEA proxy plugin is proxying the request to BEA, then the request
    is made correctly from the browser to the proxy as:
    GET /space%20demo/resource.htm HTTP/1.1
    Notic the browser is correctly URL encoding the request.
    BUT, the apache-BEA proxy plugin is incorrectly proxying the request to the BEA
    box:
    GET /space demo/resource.htm
    Notice the Apache-BEA proxy is not URL encoding the request, so when BEA gets
    it he thinks this is a request for "/space" and "demo/resource.htm" is the http
    version.
    This problem DOES NOT happen if I use the generic http proxy module provided with
    Apache.
    Has anyone seen this problem before?
    Please get back to me if you have some information.
    Thanks,
    Cole Crawford
    Paymentech

  • Character encoding problem using XSLT and Tomcat on Linux

    Hi,
    I have an application running on a Tomcat 4.1.18 application server that applies XSLT transformations to DOM objects using standard calls to javax.xml.transform API. The JDK is J2SE 1.4.1_01.
    It is all OK while running on a development enviroment (which is Windows NT 4.0 work station), but when I put it in the production enviroment (which is a red hat linux 8.0), it comes up with some kind of encoding problem: the extended characters (in spanish) are not shown as they should.
    The XSL stylesheets are using the ISO-8859-1 encoding, but I have also tried with UTF-8.
    These stylesheets are dynamicly generated from a JSP:
    // opens a connection to a JSP that generates the XSL
    URLConnection urlConn = (new URL( xxxxxx )).openConnection();
    Reader readerJsp = new BufferedReader(new InputStreamReader( urlConn.getInputStream() ));
    // Gets the object that represents the XSL
    Templates translet = tFactory.newTemplates( new StreamSource( readerJsp ));
    Transformer transformer = translet.newTransformer();
    // applies transformations
    // the output is sent to the HttpServletResponse's outputStream object
    transformer.transform(myDOMObject, new StreamResult(response.getOutputStream()) );Any help would be appreciated.

    Probably you need to set your LANG OS especific environment variable to spanish.
    Try adding this line:
    export LANG=es_ES
    to your tomcat/bin/catalina.sh, and restart tomcat.
    It should look like this:
    # OS specific support.  $var _must_ be set to either true or false.
    cygwin=false
    case "`uname`" in
    CYGWIN*) cygwin=true;;
    esac
    export LANG=es_ES
    # resolve links - $0 may be a softlink
    PRG="$0"
    .(BTW, keep using ISO-8859-1 encoding for your XSL)
    HTH
    Un Saludo!

  • Sending document to oracle xml gateway web service and body is url encoded

    Hello,
    a question from a complete newbie to web services. I have some code that is sending a soap message to an oracle xml gateway web service. In the soap message the values in the soap body look like &lt ;CNTROLAREA&gt ;
    when I would be expecting <CNTROLAREA>. What I have been told is that the content of the ReceiveDocument element has been url encoded which causes the &lt and to correct it I need to change the paramater type from object to xmlnode and to build the request as an xmldocument. The xmlnode and xmldocument comes from a .net guy so I've been trying to find the equivalent in java but am not having any luck. I have a lot of reading to do but was wondering if someone might be able to point me in the right direction on how to correct the problem. I captured the soap message being sent using tcpmon. Why does the body have the &lt instead of the < as I was expecting and is there an xmldocument type? The header part of the soap message looks as I expect. "><soapenv:Header><ns1:XMLGateway_Header xmlns:ns1="http://xmlns.oracle.com/apps/fnd/XMLGateway"><ns1:MESSAGE_TYPE>XML</ns1:MESSAGE_TYPE>. It is being sent as a com.oracle.xmlns.apps.fnd.XMLGateway.XMLGateway_Header type.
    thanks
    Thanks
    Edited by: twf123 on May 5, 2010 11:59 AM
    Edited by: twf123 on May 5, 2010 12:00 PM

    twf123 wrote:
    What I have been told is that the content of the ReceiveDocument element has been url encoded which causes the &lt and to correct it I need to change the paramater type from object to xmlnode and to build the request as an xmldocument. Where do you change the parameter type?
    The xmlnode and xmldocument comes from a .net guy so I've been trying to find the equivalent in java but am not having any luck. How do you get the data from .net guy? Which interface do you use? What processing do you do after receiving the data?

  • Encoding problem (via ORB)

    Hello,
    I posted this problem few months ago, but still havent been able to solve this.
    I have a Client Server program which communicates via ORB, i.e. using CORBA, with server running on Solaris OS and Client running on windows.
    The server returns string containing chinese characters to the client.
    However, my chinese characters dont appear properly on the client side.
    If i run the client on the Solaris OS there is no problem with it.
    I tried converting the encode of the string by getting its byte and creating
    a new string with encoding parameter. None of this seems to work.
    I can see the chinese character when the server is writing to OutputStream of CORBA, but on the InputStream of CORBA it does not
    show properly.
    Any ideas on how i can overcome this encoding problem where the C/S is
    communicating via CORBA (ORB)?
    Thanks in advance.

    Thanks for your reply
    Yes, i know the BIG5 is for Traditional Chinese and japansese is using like Shift-JIS or EUC.
    So when i try to post japanese in a BIg5 web page, i think it's normal that i can't see it in BIG5 encoding.
    But then i change the Safari default decoding to BIG5 HKSCS, the japanese appers! At the same time i can see the traditional chinese too!
    And if i use Firefox, i can both see the japanese and chinese at the default BIG5 encoding.
    So i simple think maybe safari translate my japanese into BIG5 HKSCS,not Shift-JIS. But if i use Firefox, i can get the same result with only BIG5 encoding, not BIG5 HKSCS. So i am just wondering why it's different between Safari and Firefox with the same BIG5 encoding.
    Following is a example URL
    It's a MAC discussing froum with BIG5 encoding in Taiwan.
    http://ubb.frostyplace.com.tw/viewtopic.php?t=19162
    It's a froum topic posted by me. I input some japanese into this topic
    If you browse this page with Safari BIG5 encoding, you can see a lot of question mark instead of the original japanese word that i and other people posted.
    But if you change the encoding to BIG5 HKSCS, the japanese appears. And if you using Firefox with BIG5 encoding, the japanese appears too.
    So is it someing wrong with Safari's BIG5 encoding or some other reason makes this happen?

  • URL encoding special characters in episode name

    Hello,
    Configuration :
    1 capture agent on a MAC MINI under MAC OS X 10.6.5
    1 PCP2 server on an XServe under MAC OS X 10.6.5
    I encounter this problem since 10.6.5 update :
    When I stop a Podcast capture, if episode name is for example abcd#, '#' character is "URL encoded" to '%23' sequence. So the final file name of the podcast is abcd%23.m4v instead of abcd#.m4v.
    This was not the case under 10.6.4.
    I tried this solution : renaming the file adding a task in the workflow ; this task launches a bash script which renames all files replacing '%23' sequences by a '#' character.
    Files are well renamed, but the task don't give hand back, and XGrid task never ends.
    Got this error in /var/log/system.log :
    sandbox [nnn] : bash(12146) : deny file-ioctl /path/to/bash-script
    Thanks for help

    Problem solved !
    I had a problem with rights on my podcasts directory.
    So, for those who are interested, you can add a task to your workflow, for example a bash batch file which renames all files in your podcast directory whose name contains a special character :
    for fic in `ls`
    do
    mv $fic `echo $fic | sed -e s/%23/#/g`
    done
    the additional workflow task must contain 2 items :
    --- an item "command" of type String with the path of your batch file as value
    --- an item "dependsOnTasks" of type array with an element of type string with "postflight" as value

  • URL ENCODING

    hi,
    I am devoloping using JSP pages and servlets on JRUN web server. I found that when the browser passes the URL (along with my custom parameters) to the servlet, it encodes any spaces in my parameter values with '%20'. Now am I correct that this is done using Base64encoding?? However, I am not using any encoding mechanism and this automatic conversion seems to cause a problem in that the web server thinks that it needs to authenticate this URL and is unable to process it. Does anyone know how I can turn this encoding off and pass any spaces in my parameter values as they are, or is there any other known solution to this.
    Any help will be much appreciated.
    Thanks

    hi,
    I am devoloping using JSP pages and servlets on JRUN
    web server. I found that when the browser passes the
    URL (along with my custom parameters) to the servlet,
    it encodes any spaces in my parameter values with
    '%20'. Now am I correct that this is done using
    Base64encoding?? All browsers will do this, and it's called "URL encoding". It's a little trick to use other characters than simple letters and digits in URLs (including parameters). This has nothing to do with Base64 encoding.
    However, I am not using any encoding
    mechanism The browser uses this encoding, and you (the server) cannot do anything about it. It shouldn't actually be a problem at all.
    and this automatic conversion seems to cause
    a problem in that the web server thinks that it needs
    to authenticate this URL and is unable to process it.I think you're making a mistake here. URL encoding has nothing to do with URL authentication. I guess you mean that the webserver is requesting username/password ? Then you have configured the requested URL to be authenticated at yuor webserver.
    Does anyone know how I can turn this encoding off and
    pass any spaces in my parameter values as they are, or
    is there any other known solution to this.You really don't want to turn URL encoding off. Next, it can't be 'turned off'. Jrun will automatically decode the %20 to a space again; you won't notice it has been encoded at all.
    Your problem must be somewhere else. Have a close look at your http authentication settings...
    >
    Any help will be much appreciated.
    ThanksNo problem
    Cheers,
    Tom

  • H:outputlink stop url encoding

    Hi, I have a simple outputlink like this:
    <h:outputLink value="#{myBean.myUrlFile}"/>the problem is that myUrl file can contains characters like é, à, I know this is not very a good idea but I had to deal with it.
    When the JSF is parsed a link like this is created:
    <a href="/R%E9glement.pdf"></a>I'd like that jsf don't encode the link beacause like it is not valid.
    Like this it is valid:
    <a href="/Réglement.pdf"></a>any idea?
    Thx

    But this link is used file, like a pdf file for exemple.So?
    This file can be uploaded and so can contains characters like é à ù etcThat has nothing to do with how the URL is encoded.
    What I don't understand is when the link is encoded, file is not found => 404 error.It means Not Found. Again that has nothing to do with URL-encoding.
    when the link is not encoded (so as you've said with a bad format) the file is found.Then you have a co-operating bug. Your server should be URL-decoding the URL. What is your server exactly?

  • Error #2101: The String passed to URLVariables.decode() must be a URL-encoded query string containin

    Error: Error #2101: The String passed to URLVariables.decode() must be a URL-encoded query string containing name/value pairs. at Error$/throwError() at flash.net::URLVariables/decode() at flash.net::URLVariables() at flash.net::URLLoader/onComplete() _________________________________________________________________________________________ ____________ stop(); var DepartVars:URLVariables = new URLVariables(); var DepartURL:URLRequest = new URLRequest("scripts/www.mywebsite.com/depart.php"); DepartURL.method = URLRequestMethod.POST; DepartURL.data = DepartVars; var DepartLoader:URLLoader = new URLLoader; DepartLoader.dataFormat = URLLoaderDataFormat.VARIABLES; DepartLoader.addEventListener(Event.COMPLETE, completeDepart); depart_btn.addEventListener(MouseEvent.CLICK, DepartUser); // Function to run when the Depart button is pressed function DepartUser (event:MouseEvent):void{             // Ready the variables here for sending to PHP           DepartVars.post_code = "Depart";         // Send the data to the php file           DepartLoader.load(DepartURL);         welcome_txt.text = "Processing request...Bon Voyage"; } // Close DepartUser function /////////////////////////////////////// // Function for when the PHP file talks back to flash function completedepart(event:Event):void{     if (event.target.data.replyMsg == "success") {             var refreshPage:URLRequest = new URLRequest("javascript:NewWindow=window.location.reload(); NewWindow.focus(); void(0);");             navigateToURL(refreshPage, "_self");         } // Close completeDepart function ////////////////////////////// // Code for the View res Button var viewRes:URLRequest = new URLRequest("view_res.php"); viewRES_btn.addEventListener(MouseEvent.CLICK, viewResClick); function viewResClick(event:MouseEvent):void {     navigateToURL(viewRes, "_self"); } ///////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////// // Code for the Edit Res profile Button var editRes:URLRequest = new URLRequest("edit_res.php"); editRES_btn.addEventListener(MouseEvent.CLICK, editResClick); function editResClick(event:MouseEvent):void {     navigateToURL(editRes, "_self"); } }

    I have a similar problem
    whey I use .txt my code works, but when I change to .dat external file, it get error 1067
    my code:
    import flash.display.Sprite;
    import flash.events.*;
    import flash.net.URLLoader;
    import flash.net.URLLoaderDataFormat;
    import flash.net.URLRequest;
    var loader: URLLoader = new URLLoader();
    loader.dataFormat = URLLoaderDataFormat.VARIABLES;
    loader.addEventListener(Event.COMPLETE, loading);
    loader.load(new URLRequest("rssnews.dat"));
    function loading(e: Event): void {
              news_1.text = trace(e.target.data.titulo);
              news_2.text = trace(e.target.data.texto);

Maybe you are looking for

  • Error in sending smartform as fax

    Hi everyone, I am trying to send a smartform through Fax, and i am getting the following error; Cannot process message in node, parameters cannot be converted      Message no. XS821 Diagnosis      The message cannot be processed in the node as parame

  • Best practice for default values in EO

    I have and entity called AUTH_USER (a user table) within it has 2 TIMESTAMP WITH TIME ZONE columns like this ...: EFF_DATE TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT current_timestamp, TERM_DATE TIMESTAMP WITH TIME ZONE Notice EFF_DATE has a default c

  • Technical Content Activation failed

    Hi guys, I tried to activate Technical Content via SPRO's Activate Technical Content in SAP NetWeaver BI. However, I am facing with these problems: 1. If I choose only Activate SAPI DataSources, I will get a time out. 2. If I choose only Activate Tec

  • Using Mac as the Bluetooth Audio receiver

    I have several voicemails I would like to record, and I thought it would be handy if I could send the audio from my phone via bluetooth to my Mac (instead of a headset) and then I could record them. I'm not finding much searching Google and other for

  • PGI Date and COGS accounting date should be different

    Hi All, I have a scenario where the client wants to post the COGS account when the material reach to the Customer and on the same date wants to Invoice the Customer, this is required for the Matching Concept of Accounting so that Recognition of Cost