Skip to Content
author's profile photo Former Member
Former Member

Special characters in URL parameters retrieved as question marks

Hello,

I am posting a simple HTML form to a WebDynpro application, and then I retrieve the 2 parameters with the following code :

IWDWebContextAdapter adapter = WDWebContextAdapter.getWebContextAdapter();
String comment= adapter.getRequestParameter("comment");

Problem : some special characters (those with accents for instance) are retrieved as question marks. Their ascii character is always 65533 (unicode rather?).

I guess this is a problem of charset, but where could I change it ?

Trying to encode afterwards does not change the characters, I always get the question marks. But I may not do it the right way...

Any hint on that ?

Thanks a lot.

Best Regards,

Nicolas

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Sep 21, 2007 at 08:58 AM

    Hi,

    refer to following code.

    Stop using deprecated object IWDWebContextAdapter

    IWDProtocolAdapter adapter = WDProtocolAdapter.getProtocolAdapter();
    	
    	try {
    		byte comment[]= adapter.getRequestObject().getParameter("comment").getBytes("ASCII");
    		String str = new String(comment);
    	} catch (UnsupportedEncodingException e) {
    		// TODO Auto-generated catch block
    		e.printStackTrace();
    	}

    Ashu

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Ashutosh Moharir

      Hello,

      Unfortunately that does not change anything. I always get these question marks, whatever charset I use (ASCII, UTF-8 or ISO-8859-1)...

      Looks like the bad conversion is done before, at the adapter level.

      Any help greatly appreciated...

      Nicolas

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.