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

I'm using System.Text.Encoding.Default.GetString to convert binary data to string. But the result is missing comma. For example, the expected result is N,A but the actual result is NA.
My code looks like below:

C#
Byte[] wibytes = (Byte[])dr["WI_location"];
String x = System.Text.Encoding.Default.GetString(wibytes);
lblEWi.Text = x;



Please help.

Thanks!
Posted
Updated 16-Jan-13 21:24pm
v2
Comments
Sergey Alexandrovich Kryukov 17-Jan-13 2:57am    
I cannot believe that your observation is correct, but you should make sure that you use the same encoding in conversion in both direction. Also, you encoding should be, in general case, one of Unicode UTFs.
—SA

1 solution

Try to input a double / and see the outcome.

Also try to input '\/' instead of only one /. the reason I say that is when you insert \ in front of any character it ignores any special behaviour by the character that is followed and displays it exactly as it is.
 
Share this answer
 
Comments
BabyOreo 17-Jan-13 4:17am    
Sorry. I mean i have missing comma.

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