java - Same function showing different results -
i trying encrypt data of following function in desktop application :
public string[] binarytotext(string[] binary1,int lengthofshares) { string[] encrptedfinally=new string[lengthofshares]; for(int tt=0;tt<lengthofshares;tt++){ string ss2=""; string ss=binary1[tt]; char mynextchar; for(int = 0; < ss.length(); += 8) //this little tricky. want [0, 7], [9, 16], etc { system.out.print(integer.parseint(ss.substring(i, i+8), 2)+","); mynextchar = (char)integer.parseint(ss.substring(i, i+8), 2); system.out.println(mynextchar); ss2 += mynextchar; } encrptedfinally[tt]=ss2; } return encrptedfinally; }
but when used same function in web application gives different results.the integer.parseint statement returns same value character in typecasted gets changed.
in web application positions replaced question marks '?'
web application pic in each row correspond integer , character being typecasted : http://postimg.org/image/ydn9h9nsf/
and in desktop application values :
http://postimg.org/image/ww88p3ot5/
what can reason ?please help.
the reason desktop , web applications using different character encodings.
that why under encodings value present 1 character, , in others different one.
Comments
Post a Comment