V
V
vista1x2014-10-06 15:13:18
PHP
vista1x, 2014-10-06 15:13:18

How to fix encoding when connecting via odbc?

I connect the MS Access database via odbc_connect in PHP like this:

$db = odbc_connect("Driver={Microsoft Access Driver (*.mdb)};Dbq=d:\XXX\X.mdb;", $user, $password);

Everything is connected, but Russian letters are displayed as questions. I tried adding ClientCharset=utf-8 and Charset=utf-8 and many more options, no changes. I've been scratching my head all day.
I found a similar problem on one of the forums, the author wrote that he fixed it in MS Access, but did not specify how.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Vladimir, 2014-10-06
@vista1x

Here manipulations are described, something similar to your case. forum.php.su/topic.php?forum=78&topic=4450

K
Konstantin, 2014-10-06
@fallen8rwtf

maybe cp-1251?

K
Konstantin, 2020-11-21
@Spoyk

I had this problem in odbc v 3.51.3 on Windows XP. You need to specify cp1251 in the connection settings. At the same time, on the server for the base I have utf8_general_ci

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question