Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> VARCHAR: characters or bytes?

VARCHAR: characters or bytes?

From: Art Decco <pleasedont_at_email.com>
Date: 2000/05/02
Message-ID: <8eo63d$fev$1@goodnews.macromedia.com>#1/1

When you define a field as a varchar(24), does that give it room for up to 24 bytes of text data, or does it give it room for up to 24 characters of data? After all, not all encodings are single-byte.

In particular, we're thinking of using a UTF-8 (Unicode) database to hold global customer data. We're converting the data from a previous, non-Unicode encoding. (Actually several databases, and several different encodings.) We don't want the data to overflow the field when converted, nor do we want the new field to be too narrow for new data. If a column has type varchar with a width of 24 and we convert it to UTF-8 using the same schema, that would only be enough room for about eight Japanese kanji in UTF-8 if varchar is measured in bytes, but it would be plenty if 24 referred to characters instead of bytes. Does anybody know for sure which it is? I've heard lots of opinions, but nobody seems to really know.

Thanks. Received on Tue May 02 2000 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US