je suis Tring ajouter "翻 訳 す る テ キ ス ト や Web ペ ー ジ" dans une table de PostgreSQL, mais sa montre comme ceci:Comment insérer du texte japonais dans une table Postgres en utilisant PHP?
"& #32763;""& #35379;"す& #12427;テ& #12461;& #12473;& #12488;& #12420;Web& #12506;& #12540;& #12472;
Comment puis-je insérer que dans le format approprié?
<?php
$db = pg_connect("host=localhost port=5432 dbname=lang user=password=") or die(":(");
pg_set_client_encoding($db , "UTF-8");
#pg_exec($db,"SET NAMES 'UTF-8'");
#pg_exec($db,"SET CLIENT_ENCODING TO 'UTF-8'");
//$lan=iconv("UTF-8",'ISO-8859-1//TRANSLIT',$_REQUEST['lan']);
$lan=$_REQUEST['lan'];
echo $lan;
if(array_key_exists('sub',$_REQUEST))
{
$sql="INSERT INTO table1 (japan) VALUES('{$lan}')";
pg_query($sql) or die("errot");
}
?>
<html>
<body>
<form action="" method="">
<input type="text" name="lan" />
<input type="submit" name="sub" />
</form>
</body>
</html>
quel classement dois-je utiliser? – coderex
- - vidage de base de données PostgreSQL - - Commencé le 2009-06-27 17:22:32 SET client_encoding = 'UTF8'; SET standard_conforming_strings = désactivé; SET check_function_bodies = false; SET client_min_messages = avertissement; SET escape_string_warning = off; SET search_path = public, pg_catalog; SET default_tablespace = ''; SET default_with_oids = false; - - Entrée de la table des matières 1466 (classe 1259 OID 71803) - Dépendances: 3 - Nom: table1; Type: TABLE; Schéma: public; Propriétaire: prasanth; Espace de table: - CREATE TABLE table1 ( id entier NOT NULL, caractère japonais (1000) ); – coderex