Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How can I store international / Unicode characters into a cookie?

0
10 Posted

How can I store international / Unicode characters into a cookie?

0
10

Author: Callum Bir (http://www.jguru.com/guru/viewbio.jsp?EID=1084713), Jun 16, 2003I have the same problem, and the above solution does not work. When a Javascript writes a cookie which contains say Chinese characters, when we retrieve it, it looks fine. When JSP sends the cookie, (gets the value from the parameter), the cookie appears as rubbish. The JSP page is setting the encoding to utf-8, which is the same as the input HTML form. The key problem now is really setting and retrieving say Chinese characters (or anything non english) from Java Cookie in JSP/Servlet. As long as the data is not coming through the cookie, I can get the data correctly coming through the JSP and displayed correctly in any Java Swing component. But as soon as the data comes in through the cookie, things stops working. Anything I am missing?

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.