我正在尝试直截了当的方式并且收到乱码:
注意:我在Windows 8.1上。
PHP
<?php
$db = new SQLite3(__DIR__ . "/txttest.db");
$db->exec("CREATE TABLE IF NOT EXISTS txttest (txt TEXT)");
$db->exec("DELETE FROM txttest");
$text = "ção";
$stmt = $db->prepare("INSERT INTO txttest (txt) VALUES (?)");
$stmt->bindParam(1, $text, SQLITE3_TEXT);
$stmt->execute();
?>
Git Bash
sqlite> select * from txttest;
ção
编辑:它实际上与sqlite3无关,但与Git Bash无关:Why does Git Bash not display my PHP strings correctly?