Click here to Skip to main content
15,867,568 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,


I have done conversion of byte to string ..it's working fine in my system...but shoeing error like string to byte inner exception...can any one knows please tell me ..why it is happening
my code lines are
System.Text.UTF8Encoding encoding = new System.Text.UTF8Encoding();
string customerID1 = encoding.GetString((byte[])bytedata);

please tell em anyone knows answer
Posted
Comments
tumbledDown2earth 16-Apr-13 8:07am    
On which computer is it showing error? and what is the exception?

1 solution

Depends what is in the byte array - if it is data which is outside the UTF8 character set, you will get the error.

Check how you generated the byte array in the first place, and reverse the operation! (It is likely that you didn't start with UTF8 data, but I don't know what it is, so I can't say exactly what you should be doing)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900