Vishwamohan

Welcome to Vishwa's blog - Technology, Spirituality and More...

Converting Data From ASP.NET to Classic ASP

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.

Comments (3) -

  • Acai Bær

    10/14/2009 10:56:53 AM | Reply

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

  • Industrial Machinery

    3/20/2010 7:45:25 PM | Reply

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

  • Siegfrid Wolff

    5/6/2010 2:59:34 AM | Reply

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

Loading