PC Review


Reply
Thread Tools Rate Thread

Cookie Encoding/sharing ASP.Net and ASP

 
 
=?Utf-8?B?U3RlcGhhbiBCb21ob2x0?=
Guest
Posts: n/a
 
      26th Sep 2007
Hi,

i have a little problem with cookie encoding. Our ASP.Net web-app uses
UTF-8/Unicode Encoding as default. Now we write an cookie with for example
the username in it. In Germany names can contain umlauts like äöüß...

Another web-app, written in ASP from another developer, read out the cookie
and have a problem with umlauts. They uses the ISO-8859-1 encoding, so there
are cryptic signs instead of the umlauts.

How can i save the username in the cookie with another encoding? I have
tried things like Encoding.Convert(unicode,iso, encodedBytes) but it doesn´t
work.

Thanks for any hint....

Stephan

 
Reply With Quote
 
 
 
 
Alexey Smirnov
Guest
Posts: n/a
 
      26th Sep 2007
On Sep 26, 10:52 am, Stephan Bomholt
<StephanBomh...@discussions.microsoft.com> wrote:
> Hi,
>
> i have a little problem with cookie encoding. Our ASP.Net web-app uses
> UTF-8/Unicode Encoding as default. Now we write an cookie with for example
> the username in it. In Germany names can contain umlauts like äöüß...
>
> Another web-app, written in ASP from another developer, read out the cookie
> and have a problem with umlauts. They uses the ISO-8859-1 encoding, so there
> are cryptic signs instead of the umlauts.
>
> How can i save the username in the cookie with another encoding? I have
> tried things like Encoding.Convert(unicode,iso, encodedBytes) but it doesn´t
> work.
>
> Thanks for any hint....
>
> Stephan


Hallo Stephan

according to this KB article http://support.microsoft.com/kb/313282
ASP cookies are encoded in UrlEncode format, so maybe the problem is
that you would need to decode the data using UrlDecode in ASP.NET? Try
this

 
Reply With Quote
 
Michael Nemtsev, MVP
Guest
Posts: n/a
 
      26th Sep 2007
Hello Stephan,

Mads Kristensen wrote about this recently. see there http://feeds.feedburner.com/~r/netSl...2987/post.aspx

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo


SB> Hi,
SB>
SB> i have a little problem with cookie encoding. Our ASP.Net web-app
SB> uses UTF-8/Unicode Encoding as default. Now we write an cookie with
SB> for example the username in it. In Germany names can contain umlauts
SB> like äöüß...
SB>
SB> Another web-app, written in ASP from another developer, read out the
SB> cookie and have a problem with umlauts. They uses the ISO-8859-1
SB> encoding, so there are cryptic signs instead of the umlauts.
SB>
SB> How can i save the username in the cookie with another encoding? I
SB> have tried things like Encoding.Convert(unicode,iso, encodedBytes)
SB> but it doesn´t work.
SB>
SB> Thanks for any hint....
SB>
SB> Stephan
SB>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sharing same cookie between server and client arijitdas@gmail.com Microsoft ASP .NET 2 17th Feb 2008 06:03 PM
how does ado.net SqlDataReader.GetString() know which encoding to read the data into a string as? Does sql sever set this at the column data type level, server wide encoding setting, os encoding? Daniel Microsoft C# .NET 1 25th Mar 2007 05:47 PM
how does ado.net SqlDataReader.GetString() know which encoding to read the data into a string as? Does sql sever set this at the column data type level, server wide encoding setting, os encoding? Daniel Microsoft Dot NET Framework 1 8th Mar 2007 11:06 AM
how does ado.net SqlDataReader.GetString() know which encoding to read the data into a string as? Does sql sever set this at the column data type level, server wide encoding setting, os encoding? Daniel Microsoft ADO .NET 0 7th Mar 2007 11:15 PM
how does ado.net SqlDataReader.GetString() know which encoding to read the data into a string as? Does sql sever set this at the column data type level, server wide encoding setting, os encoding? Daniel Microsoft Dot NET 0 7th Mar 2007 11:12 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:50 AM.