【发布时间】:2011-04-03 01:03:48
【问题描述】:
我正在尝试将重音字符 èòàèì 保存到 VARCHAR2 字段中的 Oracle 数据库中。我放了
<html>
<head>
<meta http-equiv="Content-type" value="text/html; charset=utf-8">
</head>
<body>
<?php
header('Content-type: text/html; charset=utf-8');
....
//在这里我将插入到数据库中:
$str=utf8_encode("JeanPièrre"); // or $str="JeanPièrre" ... is the same, it does not run
$sql="insert into TABLE(nvar) values('".$str."')";
$stmt = oci_parse($ora_conn, $sql) or die(oci_error().$query);
oci_execute($stmt);
但是重音字符没有正确保存,我看到JeanPi??rre
我能做什么?请帮助我。
提前致谢!
【问题讨论】:
-
我对 OracleDb 不太了解,但您的表/连接似乎不是 UTF-8。
标签: php oracle diacritics