473,399 Members | 4,254 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,399 software developers and data experts.

how can i set japanese string in the cookie

I am trying to set the japanese characters in this useremail cookie.
The thing is sometimes the $HTTP_COOKIE_VARS['username'] returns me a
garbled string;
Do I have to encode first before I save it in the cookie?

setcookie( "username", $username, time()+3600*24*30*12*5, "/",
www.mydomain.com, 0 );

SK
Apr 15 '06 #1
2 1278
Have you tried utf8encode($username)?

RandyTh wrote:
I am trying to set the japanese characters in this useremail cookie.
The thing is sometimes the $HTTP_COOKIE_VARS['username'] returns me a
garbled string;
Do I have to encode first before I save it in the cookie?

setcookie( "username", $username, time()+3600*24*30*12*5, "/",
www.mydomain.com, 0 );

SK

Apr 15 '06 #2

"Robin" <ro************@gmx.net> wrote in message
news:44***********************@newsread4.arcor-online.net...
Have you tried utf8encode($username)?

RandyTh wrote:
I am trying to set the japanese characters in this useremail cookie.
The thing is sometimes the $HTTP_COOKIE_VARS['username'] returns me a
garbled string;
Do I have to encode first before I save it in the cookie?

setcookie( "username", $username, time()+3600*24*30*12*5, "/",
www.mydomain.com, 0 );

SK

utf8encode

For the setcookie, I remember we don't have to do anything about the
encoding.
'cause the function itself is taking care of the encodeing issue.

The thing is sometimes works and sometimes doesn't
I don't know why this is happening.

Shinya
Apr 15 '06 #3

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

Similar topics

3
by: bhawin13 | last post by:
Following code contains japanese string that is assigned to variable $str. code ============= <?php $str = "$B%0%C%I%P%$%T%+%=(B"; ?> ========= When i am executing above program it gives me...
0
by: Manjunatha | last post by:
I created an asp page that writes to cookies and copied it to a japanese virtual folder. The cookie writing code is below. first.asp var sUserId = new String(); var sPassword = new String();...
8
by: Daniel | last post by:
I'm trying to make a site work for japanese characters. It works fine except for the alerts in javascript. The characters are stored in unicode, as this; 'コミック全巻配' Those unicode characters...
2
by: Robert M. Gary | last post by:
I'm using JRE 1.5 on Solaris Japanese (Sparc). The JVM claims its default character set is EUC-JP I'm seeing two strange things when using Japanese character sets... 1) If I write a program that...
7
by: Daniel | last post by:
I`m trying to show japanese characters in an alert, like; alert('実装されていませ'); This doesn't work as shown in this post:...
2
by: Joseph | last post by:
Hello. I have this problem. See I have a transformed XML file and I checked its contents prior to outputting it to excel file via responseset. here is the gist of the code: XmlReader reader =...
11
by: prats | last post by:
I want to write a GUI application in PYTHON using QT. This application is supposed to take in Japanese characters. I am using PyQt as the wrapper for using QT from python. I am able to take input...
1
by: schouwla | last post by:
Hi, I want to create dates in the following format: dd-MMM-yyyy e.g. 13- Mar-2007 But are seeing some problems when running on a Japanese Windows XP. Regional settings are set to JP. ...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.