Skip to Content.
Sympa Menu

freetds - Re: [freetds] hard-coded UCS-2 strings and the C standard

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Frediano Ziglio <freddyz77 AT tin.it>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] hard-coded UCS-2 strings and the C standard
  • Date: Sat, 11 Jun 2005 10:12:24 +0200

Il giorno ven, 10-06-2005 alle 14:55 -0400, Lowden, James K ha scritto:
> In src/tds/query.c we have several hard-coded UCS-2 strings e.g.:
>
> tds_put_n(tds, "s\0p\0_\0c\0u\0r\0s\0o\0r\0c\0l\0o\0s\0e", 28);
>
> Standard C (C99?) lets this be written as:
>
> tds_put_n(tds, L"sp_cursorclose", 28);
>

This is a wide string, not a UCS-2 string. On many Unix systems (*BSD,
Linux) is encoded in UCS-4, not UCS-2. "s\0p\0_\0c\0u\0r\0s\0o\0r\0c\0l
\0o\0s\0e" is always UCS2-LE.

> Which would certainly be easier on the eyes, never mind grep(1).
>
> Ye of ye olde, yea, ancient tools, what sayeth thine erstwhile compiler?
> Be it not that it choketh upon the code that is good and true! Does
> anyone have a compiler that does not understand
>
> L"something"
>
> as a UCS-2 string?
>

freddy77






Archive powered by MHonArc 2.6.24.

Top of Page