为什么我的PHP脚本输出不正确的符号而不是来自sqlite3的俄语字母?

时间:2014-12-05 09:24:39

标签: php encoding utf-8 character-encoding sqlite

我正在尝试使用我的Windows计算机上的sqlite3.exe从php 5.3使用sqlite db。 当我执行以下代码时:

header('Content-Type: text/html; charset=utf-8');
$db = new SQLite3('C:/PHP5/extras/db.sqlite');
$result = $db->query('select * from comp;');
$resx = $result->fetchArray(SQLITE3_ASSOC);
while ($resx != false){
    print_r($resx); echo "<br/>";
    $resx = $result->fetchArray(SQLITE3_ASSOC);
};

如果是俄语文本,则输出 符号。但在sqlite CLI中我看到字母'АБ'。 我试过$db->exec('PRAGMA encoding = "utf-8";');,但没有帮助。我该怎么做才能看到来自DB的俄语文本?

0 个答案:

没有答案
相关问题