Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Understanding codepages and encoding
Message
From
24/10/2006 13:40:51
Bill Oeftering
Mainstreet Computers, Inc.
Belleville, Michigan, United States
 
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
Understanding codepages and encoding
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Miscellaneous
Thread ID:
01164137
Message ID:
01164137
Views:
58
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
Map
View

Click here to load this message in the networking platform