General information
Title:
Understanding codepages and encoding
Environment versions
Network:
Windows 2003 Server
Newbee to .NET
I have a simple encrption function that modifies the ascii values in a string. The result contains ascii values from 32 - 255. I'm having a problem with some bytes over 127. I think my string is being converted to unicode. Specificaly values of 131 are converted to 63. How do I create a function that returns a string without converting it ? Thanks, code is below:
public String gaEncrypt(string tcText,string tcPass)
{
string lctext="";
int lntext=0;
int lnchar = 0;
int lnpass = 0;
for (lntext = 0; lntext < tcText.Length;lntext++)
{
lnchar = (int)tcText[lntext] + (int)tcPass[lnpass];
if ((lnchar > 0) && (lnchar < 256))
lctext=lctext+(char)lnchar;
lnpass++;
if (lnpass > tcPass.Length-1)
lnpass = 0;
}
return lctext;
}
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only