473,386 Members | 1,791 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Cookies change the character code?

Hi,

I used Cookies to store username.

In a Windows98 client, I typed some Chinese characters into the login
box in login.asp. After submit, in c.asp, the username is stored in
the cookies. The original username and the one got back from the
cookies are displied in c.asp, they are different! Use WindowsXP
client will be fine.

Can you help?

login.asp, login username:
<%@codepage=936%>
<html>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<form action="c.asp" method="post">
<input name="username"><input type="submit">
</form>
</html>

c.asp, display the usernames:
<%@codepage=936%>
<%
username=request.form("username")
response.cookies("username")=username
response.write(username & "<br>") 'these two usernames are not the
same!
response.write(request.cookies("username"))
%>
<html>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</html>
Jul 19 '05 #1
0 2729

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

20
by: Brian Burgess | last post by:
Hi all, Anyone know if this is possible? If so, on which page would the cookie be? .. On the page calling a function defined in the include file? thanks in advance.. -BB
5
by: Mark | last post by:
Hi... I'm a little perplexed. <%@Codepage="65001" %> changes how IIS/ASP will handle interpreting query string variables - i.e. it will read the querystring as being utf-8 encoded. However,...
6
by: Amit Agarwal | last post by:
How do you turn off cookies for one page in your site?
11
by: Mark | last post by:
We use cookies to maintain some state information about a users session. They are not file based due to the fact that we don't specify a expiration date. They go away when the session ends. I...
2
by: Goober | last post by:
I have an application where we have a limited number of users and a set requirement for web access. An app that I have inherited uses cookies to set certain values (i.e. what would correspond to...
3
by: Alex Nitulescu | last post by:
Sorry, I'm really confused - I'm only at the middle of my book and already I can count 4 methods to store values. Yes, I know that cookies can not store much, but what is the difference between...
1
by: Alex Nitulescu | last post by:
I have the following very simple colde (while learning about cookies and session state): Private Sub cmdAddCookie_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles...
24
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How can I see in javascript if a web browser accepts cookies?...
5
by: jheines | last post by:
I am trying to explain how cookies and sessions work in a class I teach, but I have hit a wall when it comes to the interaction between cookies and the state of the privacy settings in Internet...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.