how to avoid garbage character problem with UTF8 DB in php program? (DBMR: 1977)

~ 0 min
2016-03-09 09:45

The reason is data in the php pages was UTF-8 encoding. When the data was sent to driver manager, driver manager found the DBMaker supported unicode ODBC function, so driver manager treated the UTF-8 data as local code (OS default language encoding, ex: Shift-JIS in Japanese OS) and converted to unicode. At this moment the converted unicode data were wrong data, so the wrong data saved to DBMaker cause garbage data in and garbage data out after fetched from DBMaker.

Solutions: Using DBMaker ANSI driver, it avoids driver manager trying to convert the UTF-8 data to unicode. You modify the register file (dbmaker51_ansi_driver.reg) to suitable setting before installing it.

ANSI drive register file content includes:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\DBMaker 5.1 ANSI Driver]

"Driver"="d:\\DBMaker\\5.1\\bin\\DMAPI51a.DLL"

"Setup"="d:\\DBMaker\\5.1\\bin\\DMSET.DLL"

"APILevel"="1"

"ConnectFunctions"="YYN"

"CPTimeout"="60"

"DriverODBCVer"="03.00"

"FileUsage"="0"

"SQLLevel"="1"

The steps include:

(1) Modify DBMaker 5.1 ANSI driver name if it's not 5.1

(2) modify Driver and Setup installed directory

(3) Modify dmapi51a.dll to dmapixxa.dll if your version is not 5.1

Therefore, if you are using DBMaker 5.1 what you need to do is only (2).

Please remember remove the DSN (default is Database name) from driver manager and use "DBMaker 5.1 ansi Driver" to register DSN again. The DBMaker ANSI driver is existed after installation (dmapi51a.dll); you only need to register it. The DBMaker ANSI driver only removes the unicode ODBC function.

Version: DBMaker 5.1

Product: Normal, Bundle

Platform: Windows

Average rating 0 (0 Votes)

You cannot comment on this entry

Tags