irmsystems
asked on
Convert string to byte array using ANSI
Hi,
I have a string that was created using ANSI encoding (Created in Visual FoxPro) The string was encrypted using some math to replace the characters and when I convert the string into a char array in .NET i get different byte values. How can I convert a string into a byte array or char array using ANSI?
Thank you
I have a string that was created using ANSI encoding (Created in Visual FoxPro) The string was encrypted using some math to replace the characters and when I convert the string into a char array in .NET i get different byte values. How can I convert a string into a byte array or char array using ANSI?
Thank you
ASKER
Thanks I have tried that
Here is an example that doesn't work
My string that I need to get the bytes from:
string sTest = "ŠŒ™‹‘•“œœž";
The value of the S with the caron is 138 in FoxPro and in .NET it is 352
.NET is using UNICODE to get the byte value. I need to somehow use ANSI within .NET to get the value of 138 for the character.
Thanks
Here is an example that doesn't work
My string that I need to get the bytes from:
string sTest = "ŠŒ™‹‘•“œœž";
The value of the S with the caron is 138 in FoxPro and in .NET it is 352
.NET is using UNICODE to get the byte value. I need to somehow use ANSI within .NET to get the value of 138 for the character.
Thanks
ASKER
Hi,
I got it figured out.
Byte[] encodedBytes = System.Text.Encoding.Defau lt.GetByte s(sString) ;
I got it figured out.
Byte[] encodedBytes = System.Text.Encoding.Defau
thats nice.
dear netminder.
I think irmsystems get the exact solution from my suggesstion.
On his question he was not given the exact string / byte arry to check.
so that only I post some methods in the Ascii encoding clssas.
I dont want this kind of behavior from irmsystems
go ahead Netminder . i dont want the points
regards
prakash
I think irmsystems get the exact solution from my suggesstion.
On his question he was not given the exact string / byte arry to check.
so that only I post some methods in the Ascii encoding clssas.
I dont want this kind of behavior from irmsystems
go ahead Netminder . i dont want the points
regards
prakash
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
System.Text.ASCIIEncoding.
System.Text.ASCIIEncoding.