I am having a problem preparing a UTF8 string for IPP (internet
printing protocol) transmission. Converting integers until 639 goes
well, but beyond this, in case of 640, results in an extra byte(?).
It shoot be 0x00, 0x00, 0x02 0x80 but I get : 00, 0x00, 0x02 0xc2
0x80.
Can somebody give me a hint, please?
private String Bytes4ToString( int fourbyte)
{
Byte[] temp=BitConvert er.GetBytes(fou rbyte);
char a=(char)temp[3];
char b=(char)temp[2];
char c=(char)temp[1];
char d=(char)temp[0];
StringBuilder result=new StringBuilder() ;
result.Append(a .ToString());
result.Append(b .ToString());
result.Append(c .ToString());
result.Append(d .ToString());
return result.ToString ();
}
After this I send a stringbuilder instance "send" including this
"result" string to a webserver.
String send=build.ToSt ring();
UTF8Encoding encoding=new UTF8Encoding();
Byte[]subdata= encoding.GetByt es(send);
TIA Gert
Comment