1 Reply Latest reply: Mar 20, 2013 10:35 PM by EJP RSS

    Odd number of non-english characters get broken in windows-chrome and ff

    user13496918
      I developed jnlp applet which prints out the user input.

      When I put odd number of non-english characters(eg: chinese), chrome and firefox browser prints out the last character as question mark.

      input : 가
      output : 가��

      I checked on java console that the character is correct.

      It must be bug in communication of applet to chrome browser.

      IE prints out correctly.

      I can resolve the issue by appending white space on applet and remove it on java script.

      Anyone has any clue on the issue?

      Codes are as follows.

      MainApplet.Java
      public class MainApplet extends JApplet implements JSInterface{//, Runnable {

           public int stringOut(String sData) {
                OutData = sData;
                return 0;
           }

      }

      js File

      function TSToolkitRealWrapper ()
      {     
           var OutData;
           var OutDataNum;
      }
      var TSToolkit = new TSToolkitRealWrapper();


      var attributes = { id:'TSToolkitReal',code:'tradesign.pkitoolkit.applet.MainApplet', width:100, height:100} ;
      var parameters = {jnlp_href: getContextPath() + '/download/pkitoolkit.jnlp',
                           separate_jvm:true, classloader_cache:false} ;
      TSToolkitRealWrapper.prototype.stringOut=function(str)
      {
           
                var      nRet = TSToolkitReal.stringOut(str)     ;
                this.OutData= TSToolkitReal.OutData;
                return      nRet;
      }

      HTML
      <SCRIPT language=javascript>
      <!--
      function StringOut(form)
      {
           var data = form.data.value;
           var nRet = 0;
           var base64Data;
           nRet = TSToolkit.stringOut(data);
           if (nRet > 0)
           {
                alert(nRet + " : " + TSToolkit.GetErrorMessage());
           }
           else
           {
                form.data1.value = TSToolkit.OutData;
           }
      }

      -->
      </SCRIPT>

      Edited by: user13496918 on 2013. 3. 20 오후 7:29

      Edited by: user13496918 on 2013. 3. 20 오후 7:39

      Edited by: user13496918 on 2013. 3. 20 오후 9:17

      Edited by: user13496918 on 2013. 3. 20 오후 9:18
        • 1. Re: Even number of non-english characters get broken in windows-chrome.
          EJP
          I checked on java console that the character is correct.
          So it isn't a Java problem.
          It must be bug in communication of applet to chrome browser.
          So tell the people who make the Chrome browser.
          IE prints out correctly.
          That's a change. I've just spent nine days tracking down an IE applet problem and I'm not finished yet.

          Please omit the boldface next time. We can read. Boldface doesn't help; it makes it worse.