In Adaptive Server version 12.5 and later, database clients can take advantage of the unichar and univarchardatatypes. The two datatypes allow for the efficient storage and retrieval of Unicode data.
Quoting from the Unicode Standard, version 2.0:
“The Unicode Standard is a fixed-width, uniform encoding scheme for encoding characters and text. The repertoire of this international character code for information processing includes characters for the major scripts of the world, as well as technical symbols in common. The Unicode character encoding treats alphabetic characters, ideographic characters, and symbols identically, which means they can be used in any mixture and with equal facility. The Unicode Standard is modeled on the ASCII character set, but uses a 16-bit encoding to support full multilingual text.”
This means that the user can designate database table columns to store Unicode data, regardless of the default character set of the server.
In Adaptive Server version 12.5 through 12.5.0.3, the
server had to have a default character set of utf-8 in order to
use the unicode datatypes. However, in Adaptive Server 12.5.1 and
later, database users can use unichar and univarchar without having
to consider the default character set of the server.
To use the unichar and univarchar datatypes with jConnect, you must perform the following two tasks:
Set the jConnect version to 6. See “Setting the jConnect version” for more information.
Set the DISABLE_UNICHAR_SENDING connection property to false. See “Setting connection properties”for more information.
When the server accepts unichar and univarchar data, jConnect will behave as follows:
For all character data that a client wishes to send to the server – for example using the PreparedStatement.setString (int column, String value)– jConnect will determine if the string can be converted to the default character set of the server.
If jConnect determines that the characters cannot be converted to the character set of the server (For example, some characters cannot be represented in the character set of the server), it will send the data to the server encoded as unichar/univarchar data.
For example, if a client attempted to send a unicode Japanese character to an Adaptive Server 12.5.1 which had iso_1 as the default character set, jConnect would detect that the Japanese character could not be converted to an iso_1 character. jConnect would then send the String as unicode data.
There is a performance penalty when a client sends unichar/univarchar data to a server. This is because jConnect must perform character-to-byte conversion twice for all Strings and characters that do not map directly to the default character set of the server. This penalty is why the DISABLE_UNICHAR_SENDING connection property defaults to true.
For more information on support for unichar and univarchar datatypes, see
the manuals for Adaptive Server version 12.5 or later.
Copyright © 2003. Sybase Inc. All rights reserved. |
![]() |