Skip to Content.
Sympa Menu

freetds - Re: [freetds] collate and TDS8

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Frediano Ziglio <freddyz77 AT tin.it>
  • To: FreeTDS <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] collate and TDS8
  • Date: 08 Dec 2002 18:09:06 +0100

Il dom, 2002-12-08 alle 16:15, James K. Lowden ha scritto:
> On 07 Dec 2002 18:26:40 +0100, Frediano Ziglio <freddyz77 AT tin.it> wrote:
> >
> > > Mine 0xd0 -> 0000 0000 1101 0000 -> third: 1 width insensitive 1
> > > katatype insensitive 0 accent sensitive 1 case insensitive
> > > Yours 0x100 -> 0000 0001 0000 0000 -> second: 0 0 0 1 binary third
> > > 0000 all insensitive.
> > > Other bits ??
> > >
> >
> > Last nibble of bytes 2-3 is language modifier. Last byte is id or 0
> > Other bits confirmed, see also attachment (extracted from query I send
> > in previous mail)
> >
> > So now we know all bits of collation info. Problem is to use all info
> > and how...
>
> Frediano,
>
> Nice work! Does this represent what we now know?
>
> typedef struct
> {
> TDS_SMALLINT locale_id; /* master..syslanguages.lcid */
> TDS_UCHAR unknown;
> TDS_UCHAR sort_flags; /* high nybble only */
> TDS_UCHAR charset_id; /* or zero */
> } TDS8_COLLATION;
>
> /* SF stands for "sort flag" */
>
> #define TDS_SF_WIDTH_INSENSITIVE (TDS_UCHAR) 0x80
> #define TDS_SF_KATATYPE_INSENSITIVE (TDS_UCHAR) 0x40
> #define TDS_SF_ACCENT_SENSITIVE (TDS_UCHAR) 0x20
> #define TDS_SF_CASE_INSENSITIVE (TDS_UCHAR) 0x10
>

Quite catched

typedef struct
{
TDS_USMALLINT locale_id; /* master..syslanguages.lcid */
TDS_USMALLINT flags;
TDS_UCHAR charset_id; /* or zero */
} TDS8_COLLATION;

/* SF stands for "sort flag" */

#define TDS_SF_BIN (TDS_USMALLINT) 0x100
#define TDS_SF_WIDTH_INSENSITIVE (TDS_USMALLINT) 0x080
#define TDS_SF_KATATYPE_INSENSITIVE (TDS_USMALLINT) 0x040
#define TDS_SF_ACCENT_SENSITIVE (TDS_USMALLINT) 0x020
#define TDS_SF_CASE_INSENSITIVE (TDS_USMALLINT) 0x010

If BIN is specified other sort bits are zero
low nibble of flags is a charset specifier

At http://www.microsoft.com/globaldev/nlsweb/ you can find table to
"translate" language id to charset.

freddy77






Archive powered by MHonArc 2.6.24.

Top of Page