2021-01-29

Special character (dot) in Internet Explorer not saving correctly in Weblogic and Oracle

I am having an issue with HTML textarea in jsp form. The string(.....) got passed from jsp form(using javascript call) to WebLogic action correctly. However, when it is saved in Oracle, it turns into question mark (?????). This problem only happens in IE, Chrome works fine. I think it has to do with the encoding. I need some suggestions to fix this problem.

Thanks in advance!

I have tried the followings but the problem is still there:

  1. modify weblogic.xml
<charset-params>
  <input-charset>
    <resource-path>/*</resource-path>
    <java-charset-name>UTF-8</java-charset-name>
  </input-charset>
</charset-params> 
  1. change startWebLogic.cmd
-Dfile.encoding=UTF-8 -Doracle.jdbc.defaultNChar=true
  1. update connection string in WebLogic server
useUnicode=true&characterEncoding=UTF-8

Update:

current code

 $('.myid').on('keyup change', function(){
      $.post('action.do', {idx: $(this).attr('id'), notes: $(this).val(), 
           rand: Math.random()}, function( resp ){
            if ( resp == null || resp.indexOf("success") == -1 ) {
                alert("Failed to save notes!");
            }
     })
})

here is action.do

        request.setCharacterEncoding("UTF-8");

        // save notes with right content from user's input (...............)
        // however after refreshing the page, notes turn into ???????
        response.setContentType("text/html;charset=UTF-8");
        PrintWriter out = response.getWriter();
        try {
                out.println( message );
        } finally {
            out.flush();
            out.close();
        }

Oracle: Would this be a problem?

NLS_CHARACTERSET    US7ASCII

Thanks



from Recent Questions - Stack Overflow https://ift.tt/2MuxwjU
https://ift.tt/eA8V8J

No comments:

Post a Comment