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.