Problem is related to how FreeTDS use iconv and shift state. Last characters (I don't understand why) left in iconv as the shift state. Adding a
tds_iconv(tds, char_conv, to_client, NULL, NULL, outbuf, outbytesleft); line before return in read_and_convert and removing assert for inbuf/inbytesleft in tds_iconv fix the problem. freddy77
smime.p7s
Description: S/MIME cryptographic signature