Skip to Content.
Sympa Menu

freetds - [freetds] iconv madness

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Frediano Ziglio <freddy77 AT gmail.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: [freetds] iconv madness
  • Date: Sat, 15 Feb 2014 17:32:53 +0000

Hi,
I'm going probably to refactor a bit the iconv stuff.

1- remove of the double conversion. Some iconv implementations does
not allow conversions freely from any charset to any other allowing
mainly conversion from/to a specific charset (ie ucs4 or ucs2). These
environment will have to use GNU libiconv. The code to handle it is
quite ugly and not tested anymore and was only introduced to handle
HP-UX. It would be good to have a test program or better a test in
configure.. I'll see what I can do

2- remove tds_iconv in favour of tds_convert_stream. There are mainly
3 functions that convert a string in chunks: tds_iconv,
tds_convert_stream and tds_put_string. read_and_convert was another
but was converted to use tds_convert_stream. tds_put_string will be
converted to use tds_convert_stream too. Now mostly conversion would
go through tds_convert_stream and tds_iconv which both do conversion
in chunks. This cause a lot of strange errors and code is quite
complicated. A single function will make things easier and faster. The
result function will be quite complicated but no more than tds_iconv
now!

3- other uses could be easily be converted to use tds_convert_stream
(probably with a simple interface)

4- tds_get_char_data and callers... well... a strange mix that
probably could be simplified making more dynamically.
tds_get_char_data already handle binary data and BLOBs, it's not clear
who handle column data.

Yes, code is actually a lot complicated. Some refactoring are needed.
Row handling is ugly too.

Frediano




Archive powered by MHonArc 2.6.24.

Top of Page