Note: This blog is sorta marketing-related and less frequently updated than other blogs that I author.
If you are more of a techy-geek than a marketing wizard then cre8ive hut
will be much interesting for you.
Volkan.
Volkan.
10.22.2005
Encoding conversion methods
After discussing about encoding in thelist, I thought that it would be nice to share the two methods that I use to convert to and from server encoding and database encoding:
Hope it helps someone.
public static string ServerStringToResponseString(string value){
return Encoding.GetEncoding(setting.DatabaseCodePage).GetString(
Encoding.GetEncoding(setting.DataReadCodePage).GetBytes(value)
);
}
public static string ResponseStringToServerString(string value) {
return Encoding.GetEncoding(setting.DataReadCodePage).GetString(
Encoding.GetEncoding(setting.DatabaseCodePage).GetBytes(value)
);
}Hope it helps someone.