Some considerations for converting Chinese into Japanese

Source: Internet
Author: User

A few things to note about converting Chinese to Japanese:

The "can" word conversion process will cause an error
Possible causes:
Magic Reference, automatically adds a slash/, can be manually canceled
Php. INI setting
MAGIC_QUOTES_GP = Off
Or
if (GET_MAGIC_QUOTES_GPC ()) {
$products _description = stripslashes ($products _description);
}

After that, you receive the character you want to convert
$name = $_request[' name '];
if (GET_MAGIC_QUOTES_GPC ()) {
$products _description = stripslashes ($products _description);
}
Here to use GBK, with GB2312 incomplete, there will be errors.
$products _description=iconv (' GBK ', ' Shift_JIS ', $products _description);
And then save the character in MySQL.
During the save process, you need to escape, and if there is no escape, an error occurs.
$products _description = mysql_escape_string ($products _description);

After it is saved, it is to be shown.
If the magic reference is prohibited, remove the variable directly without any other processing
If the magic reference is open and may have to be handled, I have not tried.
If the page is encoded in Chinese, then escape back
Iconv (' Shift_JIS ', ' GBK ', $products _description)
If the page is encoded in Japanese, it is displayed directly
$products _description

The problem of transition, which has undergone a long ordeal, has finally been solved.

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.