I developed jnlp applet which prints out the user input.
When I put odd number of non-english characters(eg: chinese), chrome 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:'com.multibrowser.test.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>
*jnlp*
<?xml version="1.0" encoding="UTF-8"?>
<jnlp href="cmp.jnlp">
<information>
<title>MultiBrowser</title>
</information>
<security>
<all-permissions/>
</security>
<resources>
<j2se version="1.6+" />
<jar href="MultiBrowser.jar"/>
</resources>
<applet-desc height="200" main-class="com.multibrowser.test.MainApplet" name="MainApplet" width="200"/>
</jnlp>