Hi

I'm trying to insert utf8 values but it doesnt work. my database, tables, html and headers are all set to utf8

this is the code:

$sql = "SET CHARACTER SET utf8";
odbc_exec($conn,$sql);
$sql = "insert into translation (queue_id, lang_id, subject, text) values ($queue_id, $lang_id, '$subject', '$content')";
echo $sql;
$rs = @odbc_exec($conn,$sql);

this is the web page output:

insert into translation (queue_id, lang_id, subject, text) values (990, 5, 'עעעע', 'יייייבבבבב')

this is what phpadmin showing:
id queue_id lang_id subject text
47 990 5 עעעע יייייבבבבב

any help will be greatly appreciated
Thanks
David.

    using mysql directly and not through odbc solves the issue:

    mysql_connect(localhost,$username,$password);
    mysql_set_charset('utf8');
    @mysql_select_db($database) or die( "Unable to select database");

    $sql = "insert into translation (queue_id, lang_id, subject, text) values ($queue_id, $lang_id, '$subject', '$content')";

    $res = mysql_query($sql);

    mysql_close();

      i was under the impression that for ODBC you could specify the charset in the connector

        changed in the odbc details connection character set to utf8, but it didn't make any difference

          ok, well I don't have any personal experience with odbc, so I'm out of ideas.

            If anyone has experience of how to make it work with ODBC, I will be happy to learn. Thanks

              Write a Reply...