WORDS_BIGENDIAN (was RE: [freetds] Running FreeTDS under VMS )

Lowden, James K LowdenJK at bernstein.com
Mon May 5 12:35:57 EDT 2003


> From: ZIGLIO Frediano [mailto:Frediano.Ziglio at vodafoneomnitel.it]
> Sent: May 5, 2003 8:27 AM
> > 
> > 1.  Patch sybase_character_sets.h such that 
> tds_canonical_charset_name
> > returns "UCS-2" when passed "UCS-2LE", when compiled for VMS.  
> > 
> 
> This problem is common to many iconv version. ie HP/UX do not 
> have UCS-2LE name.
> My intention is:
> 1- check if we have GNU iconv

The way to check for GNU iconv is to add:

	AC_CHECK_FUNCS(locale_charset)

to configure.in and 

	#define HAVE_GNU_ICONV HAVE_LOCALE_CHARSET  

in tds.h.

> 2- check names using configure (source use encoded 
> ISO-8859-1, UCS-2LE, UTF-8 and UCS-4, for the moment)
> 
> Some platform do not have UCS-4 or UCS-2LE (HP/UX 10.20 have 
> ucs2 but is only big endian)
> 
> > 2.  Replace hard-coded entry with 
> > 'tds_canonical_charset_name("UCS-2LE")'.
> 
> This raise another problem. What's the "canonical charset" 
> definition? Is the name to use for iconv functions? It's the 
> more standard name?

It's the name to pass to iconv.  

> Calling tds_canonical_charset_name("UCS-2LE") in some place 
> reduce performance... 

"Premature optimization is the root of all evil."
	-- Donald Knuth

> My intention is to define source coded 
> in config.h (TDS_CHARSET_UCS4, HAVE_CHARSET_UCS4 and similar).

(I think the names should have 'CANONICAL' in them; "canonical" implies
charset in our system.)

IOW, we'll be able to use TDS_CANONICAL_ASCII instead of "ASCII"?
Regardless of iconv implementation?  That would be good.  

tds_canonical_charset_name() must be made to work anyway, if we are to
recognize the servers' names for these charsets.  

If you're very interested in making this work:

1.  Get the relevant names (available in the GNU iconv distribution).  

2.  In the "Host-specific configuration" section of configure.in, set
variables equal to that OS's canonical name for each charset we care about.


3.  In src/tds/alternative_character_sets.h and
src/tds/sybase_character_sets.h, change e.g.

        , {   "ANSI_X3.4-1968", "ASCII"    }
to 
        , {   TDS_CANONICAL_ASCII, "ASCII" }

4.  Replace the hard-coded strings with their config.h replacement macros.  

Is that what you have in mind?  

Note that patching the header files will remain necessary for any charset
name you don't address in config.h.  

--jkl


The information contained in this transmission may contain privileged and
confidential information and is intended only for the use of the person(s)
named above.  If you are not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient, any
review, dissemination, distribution or duplication of this communication is
strictly prohibited. If you are not the intended recipient, please contact
the sender immediately by reply e-mail and destroy all copies of the
original message. Please note that we do not accept account orders and/or
instructions by e-mail, and therefore will not be responsible for carrying
out such orders and/or instructions.





More information about the FreeTDS mailing list