freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
- From: "ZIGLIO Frediano" <Frediano.Ziglio AT vodafoneomnitel.it>
- To: "Freetds (E-mail)" <freetds AT lists.ibiblio.org>
- Subject: [freetds] tds_get_char_data and iconv
- Date: Fri, 2 May 2003 10:55:33 +0200
tds_get_char_data need some work. The caller know the "wire_size", so there's
no reason to compute (there is also no good way to compute it...). tds_iconv
call lead to buffer overflow (destination size is never decremented...). If
we pass curcol there is no need to pass dest. IMHO a good prototype is:
int tds_get_char_data(TDSSOCKET * tds, const TDSCOLINFO * curcol, int
wire_size)
(if we want to discard data just call tds_get_n with NULL destination...)
iconv. This strange function is quite standard (present in solaris, hp/ux,
linux, *bsd, mac os x...). However it's names aren't (as stated in many mail
before). Consider iso8859-1 (this should be the standard name).
Max OS X: ISO-8859-1 (do not accept ISO8859-1)
Solaris: 88591
HP/UX: iso88591
So there are no solution for all platform. IMHO configure should check all
standard names using iconv command (not iconv function so it should work on
cross compiler too).. Should we define some required charset ??
Another problem is conversions. GNU iconv accept conversion from any charset
to any charset. Many implementation accept a limited conversion (for example
in HP/UX I can convert iso88591 -> ucs2 and ucs2 -> iso88592 but it can't
convert iso88591 -> iso88592). Samba solution is: if a direct conversion is
not present convert to ucs2 first (GNU iconv internally convert chars to ucs4
and than ucs4 to destination charset)...
freddy77
-
[freetds] tds_get_char_data and iconv,
ZIGLIO Frediano, 05/02/2003
- <Possible follow-up(s)>
- RE: [freetds] tds_get_char_data and iconv, Lowden, James K, 05/02/2003
Archive powered by MHonArc 2.6.24.