Converting Data From ASP.NET to Classic ASP

by Vishwa 26. June 2009 07:27

Recently I came across a situation when I had to encrypt certain piece of data into ASP.NET and then read the same encrypted data for decryption into Classic ASP. Spent several hours and could not understand why the same encryption/decryption method used in both are producing entirely two different characters. After doing some tests, finally concluded that it is an issue of character Encoding.  By default ASP.NET produces data in UTF8 Charset and UTF8Encoding Content Encoding . Whereas Classic ASP defaults to null Charset. After all research and headache following one line of code fixed this issue and both started talking to each other.

In ASP.NET Page, on page Load event add following line

Response.ContentEncoding = Encoding.Default

This default value shows as SBCSCodePageEncoding, not sure if that is showing because of my environment or configuration settings but it fixed my issue.

Tags: ,

.NET

Comments (3) -

Acai Bær
Acai Bær Denmark
10/14/2009 10:56:53 AM #

Great writeup.. I guess you summed it all up.. Cheers

Industrial Machinery
Industrial Machinery United States
3/20/2010 7:45:25 PM #

We would be interested in advertising on this site. Can you please contact us? Thanks

Siegfrid Wolff
Siegfrid Wolff United States
5/6/2010 2:59:34 AM #

Really fine blog post, hope you'll remain on this matter? greatest wishes from germany.

Comments are closed

About Me

Me Hello,my name is
Vishwa Mohan Kumar, PMP
MCP SOA Certified Architect
I am a Software Architect. This blog is result of my experiments.

Flickr Photos

Calendar

<<  February 2012  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
2728291234
567891011

View posts in large calendar

Archive

Recent Comments

Comment RSS

Live Traffic Feed