Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
409 views
in Technique[技术] by (71.8m points)

encoding - 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

question from:https://stackoverflow.com/questions/65910656/special-character-dot-in-internet-explorer-not-saving-correctly-in-weblogic-an

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...