• No se han encontrado resultados

Methods for

OEM Data

If a database has OEM character data in it, a legacy solution is to specify OEM/ANSI conversion in the access method. This topic discusses some legacy methods for Linux clients using OEM character data.

Note While the legacy methods are still supported, the recommendation is to specify the OEM code page for the database and have the access methods use automatic translation as discussed above.

Server Default

or

A specific code page

Nothing (no encoding specified)

(No encoding specified is the default behavior in versions prior to Pervasive PSQL v10.10.)

Sends data to the database engine in the encoding of the client machine and ignores database code page.

For compatible data interpretation, the encoding used by the client machine must match the encoding of the data and metadata in the database. Server Default

or

A specific code page

A specific encoding Sends data to the server in the encoding specified by the client application and ignores database code page. For compatible data interpretation, the encoding specified by the client application must match the encoding of the data and metadata in the database.

Table 7 Interaction Between Database Encoding and Client Encoding If Database Encoding Is And the Client Application

Specifies

Btrieve and DTI

When using the Btrieve API or the Distributed Tuning Interface (DTI), you must provide file names and paths in the local encoding used in your application. The Btrieve API and DTI handle the differences between OS encoding on the server and client. ODBC

See also OEM/ANSI Conversion in SQL Engine Reference.

When using ODBC, Win32 encoding is expected to be SHIFT-JIS. Japanese versions of Linux by default have their encodings typically set to EUC-JP or UTF-8.

When using Japanese versions of Linux, a client can connect to another Linux server (for example, locally), or to a Win32 SHIFT-JIS server. It is also possible to connect to a database encoded in SHIFT- JIS but located on a Linux server.

Use the following instructions for your listed configuration. In each case, it is assumed that the application itself does not do any conversion and uses the encoding that is native for the machine. „ Connecting a Linux EUC-JP Client to a Win32 SHIFT-JIS Server

„ Connecting a Linux UTF-8 Client to a Win32 SHIFT-JIS Server

„ Connecting a Linux EUC-JP Client to a Linux EUC-JP Server

„ Connecting a Linux UTF-8 Client to a Linux UTF-8 Server

„ Connecting a Linux UTF-8 Client to a Linux EUC-JP Server

„ Connecting a Linux EUC-JP Client to a Linux EUC-JP Server, with SHIFT-JIS Encoding Used to Store Data on the Server

Connecting a Linux EUC-JP Client to a Win32 SHIFT-JIS Server

The server requires that everything is received as SHIFT-JIS. The client requires that the server send everything as EUC-JP.

To accomplish this, the client DSN settings in ODBC.INI (located by default in /usr/local/psql/etc) used to connect to the given database should be set up as follows:

[dbclient]

Driver=/usr/local/psql/lib/libodbcci.so

Description=Pervasive ODBC Client Interface: JPN- 2000SERVER:1583/dbclient

Data Encoding ServerName=JPN-2000SERVER:1583

TranslationDLL=/usr/local/psql/lib/libxlate.so.10 TranslationOption=90000932

The TranslationDLL line specifies the translation library that the ODBC client interface should use.

The TranslationOption line specifies that the translation needs to occur from 9000 (representing EUC-JP) to 0932 (representing SHIFT-JIS).

Using this example, all data coming from the client will be translated into SHIFT-JIS before it gets to the server, and to EUC-JP before the data is received by the client.

Connecting a Linux UTF-8 Client to a Win32 SHIFT-JIS Server

The server requires that everything is received as SHIFT-JIS. The client requires that the server send everything as UTF-8.

To accomplish this, the client DSN settings in ODBC.INI (by default in /usr/local/psql/etc) used to connect to the given database should be set up as follows:

[dbclient]

Driver=/usr/local/psql/lib/libodbcci.so

Description=Pervasive ODBC Client Interface: JPN- 2000SERVER:1583/dbclient

ServerDSN=DEMODATA

ServerName=JPN-2000SERVER:1583

TranslationDLL=/usr/local/psql/lib/libxlate.so.10 TranslationOption=90010932

The TranslationDLL line specifies the translation library that the ODBC client interface should use.

The TranslationOption line specifies that the translation needs to occur from 9001 (representing UTF-8) to 0932 (representing SHIFT- JIS).

Using this example, all data coming from the client will be translated into SHIFT-JIS before it gets to the server, and to UTF-8 before the data is received by the client.

Connecting a Linux EUC-JP Client to a Linux EUC-JP Server

Using this configuration, no changes to the DSN description are needed. Use the DSN as it was created by the dsnadd utility.

Connecting a Linux UTF-8 Client to a Linux UTF-8 Server

Using this configuration, no changes to the DSN description are needed. Use the DSN as it was created by the dsnadd utility. See

dsnadd in Pervasive PSQL User's Guide.

Connecting a Linux UTF-8 Client to a Linux EUC-JP Server

The server requires that everything is received as EUC-JP. The client requires that server send everything as UTF-8.

To accomplish this, the client DSN settings in ODBC.INI (by default in /usr/local/psql/etc) used to connect to the given database should be set up as follows:

[dbclient]

Driver=/usr/local/psql/lib/libodbcci.so

Description=Pervasive ODBC Client Interface: JPN- 2000SERVER:1583/dbclient

ServerDSN=DEMODATA

ServerName=JPN-2000SERVER:1583

TranslationDLL=/usr/local/psql/lib/libxlate.so.10 TranslationOption=90019000

The TranslationDLL line specifies the translation library that the ODBC client interface should use.

The TranslationOption line specifies that the translation needs to occur from 9001 (representing UTF-8) to 9000 (representing EUC- JP).

Using this example, all data coming from the client will be translated into EUC-JP before it gets to the server, and to UTF-8 before the data is received by the client.

Connecting a Linux EUC-JP Client to a Linux EUC-JP Server, with SHIFT-JIS Encoding Used to Store Data on the Server

This situation is possible if you have a SHIFT-JIS database on a Win32 engine, and you want to move all the files to the Linux EUC- JP server. In this case, the database resides on a EUC-JP Linux machine, but all the data inside the DDF files and data files are in SHIFT-JIS.

In this case, your DSN should be set up as follows:

[dbclient]

Driver=/usr/local/psql/lib/libodbcci.so

Description=Pervasive ODBC Client Interface: JPN- 2000SERVER:1583/dbclient

Data Encoding ServerDSN=DEMODATA ServerName=JPN-2000SERVER:1583 TranslationDLL=/usr/local/psql/lib/libxlate.so.10 TranslationOption=90000932 CodePageConvert=932

The last line specifies that even though the server uses EUC-JP encoding, it should treat the data on the server as SHIFT-JIS.