When an application is converted to use Unicode data in the database, is it necessary to change the collation algorithm to UCA?

http://dcx.sybase.com/index.html#1201/en/sachanges/unloading-reloading-upgrading-newjasper.html

asked 12 Apr '11, 12:14

Breck%20Carter's gravatar image

Breck Carter
27.4k424585838
accept rate: 21%


AFAIK (but John will know faaaaar better), unicode data will use the UCA collation by default, cf. this quote from the DBINIT docs:

-zn
Specifies the collation sequence used for sorting and comparing of national character data types (NCHAR, NVARCHAR, and LONG NVARCHAR). The collation provides character ordering information for the UTF-8 encoding (character set) being used. Values are UCA (the default), or UTF8BIN which provides a binary ordering of all characters whose encoding is greater than 0x7E. If the dbicu12 and dbicudt12 DLLs are not installed, then the default NCHAR collation is UTF8BIN. For more information, see Choosing collations

So I would conclude that you would not have to change the default collation for (non-unicode) char data.

permanent link

answered 12 Apr '11, 12:52

Volker%20Barth's gravatar image

Volker Barth
30.0k294448654
accept rate: 32%

edited 13 Apr '11, 05:44

More directly, UCA is not required to use Unicode in the database: you can also use UTF8BIN. The primary difference is in how values sort & compare. For example, you cannot even do accent-insensitve comparisons with UTF8BIN let alone complex linguistically correct sorting.

(12 Apr '11, 21:27) John Smirnios

@Volker: UCA is the default for -zn, which does not apply in this case because the database has no NCHAR columns. I think dbinit -z is more pertinent in my case.

(13 Apr '11, 12:59) Breck Carter
Replies hidden

How do you use unicode data when not using NCHAR columns? - Does it mwan you just want to use a linguistically correct collation but store narrow chars? (If so, I misunderstood your requirements...)

(13 Apr '11, 13:01) Volker Barth
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×45

question asked: 12 Apr '11, 12:14

question was seen: 912 times

last updated: 13 Apr '11, 13:01