Sybase 12.4.2 Connection strings and character sets, Avoiding character-set translation, 338

Models: 12.4.2

1 536
Download 536 pages 20.34 Kb
Page 358
Image 358

Understanding character set translation

Connection strings and character sets

Connection strings present a special case for character set translation. The connection string is parsed by the client library, in order to locate or start a database server. This parsing is done with no knowledge of the server character set or language.

The interface library parses the connection string as follows:

1It is broken down into its keyword = value components. This can be done independently of character set, as long as you do not use the curly braces {} around CommLinks parameters. Instead, use the recommended parentheses (). Curly braces are valid follow bytes in some multi-byte character sets.

2The server is located. The server name is interpreted according to the character set of the client machine. In the case of Windows operating systems, the ANSI character set is used. Extended chars can be used unless they cause character set conversion issues between client and server machine.

For maximum compatibility among different machines, you should use server names built from ASCII characters 1 to 128 , using no punctuation characters. Server names are truncated at 40 characters.

3The DatabaseName or DatabaseFile parameter is interpreted in the database server character set.

4Once the database is located, the remaining connection parameters are interpreted according to its character set.

Avoiding character-set translation

There is a performance cost associated with character set translation. If you can set up an environment such that no character set translation is required, then you do not have to pay this cost, and your setup is simpler to maintain.

If you work with a single-byte character set and are concerned only with seven- bit ASCII characters (values 1 through 127), then you do not need character set translation. Even if the code pages are different in the database and on the client operating system, they are compatible over this range of characters. Many English-language installations will meet these requirements.

If you do require use of extended characters, there are other steps you may be able to take:

338

Page 358
Image 358
Sybase 12.4.2 manual Connection strings and character sets, Avoiding character-set translation, 338