Use Javascript to read Chinese cookies set in PHP. LieHuo. Net PHP Tutorial PHP program writes some Chinese data in the COOKIE, but cannot be correctly displayed when reading Javascript? I believe many of my friends have met this situation.
Tutorial
Javascript strings are all string objects. You can use the length attribute of the string object to obtain the length. However, the minimum length unit is 1 for Chinese characters, full-angle characters, and English characters, this is not the same
Php encryption and js decryption seem meaningless, mainly because Keys will be seen in js, however, the following function code may be used in some places. "123456" is an encrypted key and can be changed as needed.
Php encryption and js decryption
A UTF-8 encoded Unicode function implemented by php
Function Utf8ToUnicode (strUtf8)
{
Var bstr = "";
Var nTotalChars = strUtf8.length; // total chars to be processed.
Var nOffset = 0; //
This article describes in detail how to simulate single-point logon using curl in php and how to implement JS encryption functions using PHP.
Php curl simulates single-point logon
Here, the simulated logon, that is, the basic part of the website
Php judges Chinese characters and codes. gbk indicates dubyte, and utf8 indicates three bytes. It can be determined based on the range of Chinese characters.
Php judges Chinese characters and codes. gbk indicates dubyte, and utf8 indicates three
IntroducedIn front-end development, in order to make Chinese in different environments can be very good display, the general is to convert Chinese into Unicode format, that is, \u4f60, such as: "Hello Ah," The Unicode Encoding
Php judges Chinese characters and codes. gbk indicates dubyte, and utf8 indicates three bytes. it can be determined based on the range of Chinese characters.
Encoding range: 1. GBK (GB2312/GB18030)
\ X00-\ xff GBK dubyte encoding range
\ X20-\ x7f
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.